/*!common/widgets/policy-update/main.js*/
;define('common/widgets/policy-update/main', ['require', 'exports', 'module', "common/components/modal/modal", 'dep/jquery.cookie/jquery.cookie'], function(require, exports, module) {

  require("common/components/modal/modal");
  require('dep/jquery.cookie/jquery.cookie');
  
  var host = "https://gate.lagou.com";
  
  var COOKIE_NAME = "privacyPolicyPopup";
  
  
  
  function setCookie(val) {
      $.cookie(COOKIE_NAME, val, { domain: ".lagou.com", expires: 7 }); 
  }
  
  
  function showPopUp()  {
      $(".policy-update").modal("show");
  }
  
  function isShowPopUp(showCb, notShowCb) {
      $.lgAjax({
          type: 'get',
          headers: {
              'X-L-REQ-HEADER': '{deviceType: 1}'
          },
          xhrFields: {
              withCredentials: true
          },
          url: host + '/v1/entry/privacyPolicy/query',
          dataType: 'json',
          needNoToken: true
      }).done(function (result) {
          if (result.state != 1) {
              return;
          }
          if (result.content.popUp) {
              showCb && showCb();
          } else {
              notShowCb && notShowCb();
          }
      })
  }
  
  function initPop() {
      if (window.location.href.indexOf("privacy.html") > -1 || window.location.href.indexOf("policy.html") > -1 ) {
          return;
      }
  
  
      if (typeof $.cookie(COOKIE_NAME) === "undefined" || $.trim($.cookie(COOKIE_NAME)) === "") {
          isShowPopUp(function() {
              // 展示弹窗
              setCookie(true); 
              showPopUp();
          }, function() {
              // 不展示弹窗
              setCookie(false); 
          });
      } else if ($.cookie(COOKIE_NAME) === "true") {
          showPopUp();
      }
  
      $(".policy-update .comfirm-btn").bind("click", function() {
          $.lgAjax({
              type: 'post',
              headers: {
                  'X-L-REQ-HEADER': '{deviceType: 1}'
              },
              xhrFields: {
                  withCredentials: true
              },
              url: host + '/v1/entry/privacyPolicy/userConfirm',
              dataType: 'json',
              needNoToken: true
          }).done(function (result) {
              setCookie(false); 
              $(".policy-update").modal("hide");
          }).fail(function() {
              setCookie(false); 
              $(".policy-update").modal("hide");
          })
          
      });
  }
  
  initPop();
  
  

});
/*!community/modules/common/main.js*/
;/**
 * 问答社区-公用脚本
 *
 * @author fridayhu@lagou.com
 *
 * jquery-colorbox
 * @require "common/components/jquery-colorbox-custom/jquery-colorbox.css"
 *
 */

define('community/modules/common/main', ['require', 'exports', 'module', 'common/widgets/passport/passport', 'dep/jquery-colorbox/jquery.colorbox'], function(require, exports, module) {

	require('common/widgets/passport/passport');
	require('dep/jquery-colorbox/jquery.colorbox');

	var config = {
		// 公共接口
		url: {
			// 获取推荐话题
			getRecommendedTopic: GLOBAL_DOMAIN.zctx + '/topic/topicRecommondList.json',
			// 获取推荐问题
			getRecommendedQuestion: GLOBAL_DOMAIN.zctx + '/question/questionRecommondList.json',
			// 关注话题
			followTopic: GLOBAL_DOMAIN.zctx + '/attention/attentionTopic.json',
			// 取消关注话题
			cancelFollwTopic: GLOBAL_DOMAIN.zctx + '/attention/cancelAttentionTopic.json',
			// 关注问题
			followQuestion: GLOBAL_DOMAIN.zctx + '/attention/attentionQuestion.json',
			// 取消关注问题
			cancelFollowQuestion: GLOBAL_DOMAIN.zctx + '/attention/cancelAttentionQuestion.json',
			// 点赞回答
			supportAnswer: GLOBAL_DOMAIN.zctx + '/star/starAnswer.json',
			// 取消点赞回答
			cancelSupportAnswer: GLOBAL_DOMAIN.zctx + '/star/cancelStarAnswer.json',
			// 上传用户头像
			uploadAndcutPic: GLOBAL_DOMAIN.zctx + '/user/uploadAndcutPic.json',
			// 用户名校验
			validateUserName: GLOBAL_DOMAIN.zctx + '/user/validateUserName.json',
			// 保存、修改用户信息
			saveUserinfo: GLOBAL_DOMAIN.zctx + '/user/saveInfo.json',
			// 上传回答图片
			uploadAnswerPic: GLOBAL_DOMAIN.zctx + '/answer/uploadAnswerPic.json',
			// 保存答案
			saveAnswer: GLOBAL_DOMAIN.zctx + '/answer/saveAnswer.json',
			// 编辑答案
			editAnswer: GLOBAL_DOMAIN.zctx + '/answer/editAnswer.json',
			// 获取向谁提问列表
			getAskToList: GLOBAL_DOMAIN.zctx + '/question/getAskToList.json',
			// 搜索话题
			searchTopic: GLOBAL_DOMAIN.zctx + '/topic/searchTopic.json',
			// 添加话题
			saveTopic: GLOBAL_DOMAIN.zctx + '/topic/saveTopic.json',
			// 提问
			addQuestion: GLOBAL_DOMAIN.zctx + '/question/addQuestion.json',
			// 关注用户
			followUser: GLOBAL_DOMAIN.zctx + '/attention/followUser.json',
			// 取消关注用户
			cancelFollowUser: GLOBAL_DOMAIN.zctx + '/attention/cancelfollowUser.json',
			// 获赞Rank
			getStarRank: GLOBAL_DOMAIN.zctx + '/star/queryGainStarRanking.json',
			// 获取点赞列表
			getStarUserList: GLOBAL_DOMAIN.zctx + '/star/starUserList.json',
			// 搜索问题
			searchQuestion: GLOBAL_DOMAIN.zctx + '/question/searchQuestionJson.json'
		},
		// 首页接口
		indexURL: {
			// 加载更多
			getMoreNews: GLOBAL_DOMAIN.zctx + '/indexMoreNewsList.json',
			// 左侧推荐话题（暂时同公共获取推荐话题接口）
			getRecommendedTopic: GLOBAL_DOMAIN.zctx + '/topic/topicRecommondList.json'
		},
		// 话题列表页接口
		topicListURL: {
			// 加载更多
			getMoreTopics: GLOBAL_DOMAIN.zctx + '/topic/getTopicList.json'
		},
		// 话题详情页接口
		topicDetailURL: {
			// 加载更多
			getMoreTopicNews: GLOBAL_DOMAIN.zctx + '/topic/moreTopicNewsList.json'
		},
		// 起始页（完善个人信息）
		publisherUrl: {
			// 用户名校验
			validate: GLOBAL_DOMAIN.zctx + '/user/validateUserName.json'
		},
		// 起始页（选择关注话题）
		selectTopicUrl: {
			// 换一换
			changeTopicList: GLOBAL_DOMAIN.zctx + '/user/changeTopicList.json',
			// 保存起始关注话题列表
			saveAttentionTopicList: GLOBAL_DOMAIN.zctx + '/user/saveAttentionTopicList.json'
		},
		// 问题页接口
		questionPageUrl: {
			// 加载更多回答
			getAnswerList: GLOBAL_DOMAIN.zctx + '/question/getAnswerList.json',
			// 邀请回答
			inviteAnswer: GLOBAL_DOMAIN.zctx + '/invitation/sendInvite.json',
			// 保存草稿
			saveAnswerDraft: GLOBAL_DOMAIN.zctx + '/answer/saveAnswerDraft.json'
		},
		// 回答页接口
		answerPageUrl: {
			// 加载更多评论
			getCommentList: GLOBAL_DOMAIN.zctx + '/comment/getComment.json',
			// 添加评论
			addComment: GLOBAL_DOMAIN.zctx + '/comment/addComment.json',
			// 回复评论
			replyComment: GLOBAL_DOMAIN.zctx + '/comment/replyComment.json',
			// 删除评论
			deleteComment: GLOBAL_DOMAIN.zctx + '/comment/deleteComment.json',
			// 删除答案
			deleteAnswer: GLOBAL_DOMAIN.zctx + '/answer/delAnswer.json'
		},
		personalPageUrl: {
			// 加载更多
			moreUserNewsList: GLOBAL_DOMAIN.zctx + '/user/moreUserNewsList.json',
			// 获取用户的粉丝列表
			getFollowersList: GLOBAL_DOMAIN.zctx + '/attention/getFollowersList.json',
			// 获取用户的关注列表
			getFollowingList: GLOBAL_DOMAIN.zctx + '/attention/getFolloweesList.json'
		}
	};

	exports.config = config;

	var helper = {
		/**
		 * [ajax 异步请求辅助方法]
		 * @param  {[Object]} option [ajax配置]
		 * option.url {[String]} [请求地址]
		 * option.type {[String]} [请求方式，默认GET]
		 * option.params {[Object]} [请求参数]
		 */
		ajax: function(option) {

			if (!option.url) {
				return;
			}

			var config;
			// 分析url是否跨域
			if (analyzeUri(option.url)) {
				config = {
					url: option.url,
					dataType: 'jsonp',
					jsonp: 'jsoncallback',
					data: option.data || {}
				};
			} else {
				config = {
					url: option.url,
					type: option.type || 'GET',
					dataType: 'json',
					data: option.data || {}
				};
			}

			return $.lgAjax(config);

		},
		/**
		 * [supportAnswer 点赞回答]
		 * @param  {[Number]} id      [回答id]
		 * @param  {[Object]} handler [回调]
		 * handler.done {[Function]} [点赞成功回调]
		 * handler.fail {[Function]} [点赞失败回调]
		 * handler.always {[Function]} [ajax请求执行完成回调]
		 */
		supportAnswer: function(id, handler) {
			if (!helper.checkUserStatus({
					checkAuthority: false
				})) {
				handler && handler.fail && handler.fail();
				handler && handler.always && handler.always();
				return;
			}
			helper.ajax({
				url: config.url.supportAnswer,
				data: {
					answerId: id
				}
			}).done(function(data) {
				if (data.state == 1) {
					handler && handler.done && handler.done(data);
				} else if (data.state == 304) {
					PASSPORT.loginPopup();
					handler && handler.fail && handler.fail();
				} else if (data.state == 201) {
					helper.alertTips('参数错误');
					handler && handler.fail && handler.fail();
				} else if (data.state == 202) {
					helper.alertTips('不好意思，服务器开了个小差，点赞失败！');
					handler && handler.fail && handler.fail();
				} else if (data.state == 203) {
					helper.alertTips('你点赞的答案已经不存在了！');
					handler && handler.fail && handler.fail();
				} else if (data.state == 204) {
					helper.alertTips('你已经点过赞了');
					handler && handler.fail && handler.fail();
				} else if (data.state == 205) {
					helper.alertTips('你不需要给自己的答案点赞');
					handler && handler.fail && handler.fail();
				} else if (data.state == 10000) {
					helper.alertTips('没有权限');
					handler && handler.fail && handler.fail();
				} else {
					console.log(data.message);
					handler && handler.fail && handler.fail();
				}
			}).fail(function() {
				console.log('supportAnswer error');
				handler && handler.fail && handler.fail();
			}).always(function() {
				handler && handler.always && handler.always();
			});
		},
		/**
		 * [cancelSupportAnswer 取消点赞回答]
		 * @param  {[Number]} id      [回答id]
		 * @param  {[Object]} handler [回调]
		 * handler.done {[Function]} [取消成功回调]
		 * handler.fail {[Function]} [取消失败回调]
		 * handler.always {[Function]} [ajax请求执行完成回调]
		 */
		cancelSupportAnswer: function(id, handler) {
			if (!helper.checkUserStatus({
					checkAuthority: false
				})) {
				handler && handler.fail && handler.fail();
				handler && handler.always && handler.always();
				return;
			}
			helper.ajax({
				url: config.url.cancelSupportAnswer,
				data: {
					answerId: id
				}
			}).done(function(data) {
				if (data.state == 1) {
					handler && handler.done && handler.done(data);
				} else if (data.state == 304) {
					PASSPORT.loginPopup();
					handler && handler.fail && handler.fail();
				} else if (data.state == 201) {
					helper.alertTips('参数错误');
					handler && handler.fail && handler.fail();
				} else if (data.state == 202) {
					helper.alertTips('不好意思，服务器开了个小差，点赞取消失败！');
					handler && handler.fail && handler.fail();
				} else if (data.state == 203) {
					helper.alertTips('你取消点赞的答案已经不存在了！');
					handler && handler.fail && handler.fail();
				} else if (data.state == 204) {
					helper.alertTips('你已经取消点赞了');
					handler && handler.fail && handler.fail();
				} else if (data.state == 10000) {
					helper.alertTips('没有权限');
					handler && handler.fail && handler.fail();
				} else {
					console.log(data.message);
					handler && handler.fail && handler.fail();
				}
			}).fail(function() {
				console.log('cancelSupportAnswer error');
				handler && handler.fail && handler.fail();
			}).always(function() {
				handler && handler.always && handler.always();
			});
		},
		/**
		 * [followTopic 关注话题]
		 * @param  {[Number]} id [话题id]
		 * @params  {[Object]} handler [回调]
		 * handler.done {[Function]} [关注成功回调]
		 * handler.fail {[Function]} [关注失败回调]
		 * handler.always {[Function]} [ajax请求执行完成回调]
		 */
		followTopic: function(id, handler) {
			if (!helper.checkUserStatus({
					checkAuthority: false
				})) {
				handler && handler.fail && handler.fail();
				handler && handler.always && handler.always();
				return;
			}
			helper.ajax({
				url: config.url.followTopic,
				data: {
					topicId: id
				}
			}).done(function(data) {
				if (data.state == 1) {
					handler && handler.done && handler.done(data);
				} else if (data.state == 304) {
					PASSPORT.loginPopup();
					handler && handler.fail && handler.fail();
				} else if (data.state == 201) {
					helper.alertTips('参数错误');
					handler && handler.fail && handler.fail();
				} else if (data.state == 202) {
					helper.alertTips('不好意思，服务器开了个小差，关注失败！');
					handler && handler.fail && handler.fail();
				} else if (data.state == 203) {
					helper.alertTips('你关注的话题已经不存在了！');
					handler && handler.fail && handler.fail();
				} else if (data.state == 204) {
					helper.alertTips('你已经关注过该话题');
					handler && handler.fail && handler.fail();
				} else if (data.state == 10000) {
					helper.alertTips('没有权限');
					handler && handler.fail && handler.fail();
				} else {
					console.log(data.message);
					handler && handler.fail && handler.fail();
				}
			}).fail(function() {
				console.log('followTopic error');
				handler && handler.fail && handler.fail();
			}).always(function() {
				handler && handler.always && handler.always();
			});
		},
		/**
		 * [cancelFollwTopic 取消关注话题]
		 * @param  {[Number]} id [话题id]
		 * @params  {[Object]} handler [回调]
		 * handler.done {[Function]} [取消成功回调]
		 * handler.fail {[Function]} [取消失败回调]
		 * handler.always {[Function]} [ajax请求执行完成回调]
		 */
		cancelFollwTopic: function(id, handler) {
			if (!helper.checkUserStatus({
					checkAuthority: false
				})) {
				handler && handler.fail && handler.fail();
				handler && handler.always && handler.always();
				return;
			}
			helper.ajax({
				url: config.url.cancelFollwTopic,
				data: {
					topicId: id
				}
			}).done(function(data) {
				if (data.state == 1) {
					handler && handler.done && handler.done(data);
				} else if (data.state == 304) {
					PASSPORT.loginPopup();
					handler && handler.fail && handler.fail();
				} else if (data.state == 201) {
					helper.alertTips('参数错误');
					handler && handler.fail && handler.fail();
				} else if (data.state == 202) {
					helper.alertTips('不好意思，服务器开了个小差，取消关注话题失败！');
					handler && handler.fail && handler.fail();
				} else if (data.state == 203) {
					helper.alertTips('你取消关注的话题已经不存在了！');
					handler && handler.fail && handler.fail();
				} else if (data.state == 204) {
					helper.alertTips('你已经取消关注过该话题');
					handler && handler.fail && handler.fail();
				} else if (data.state == 10000) {
					helper.alertTips('没有权限');
					handler && handler.fail && handler.fail();
				} else {
					console.log(data.message);
					handler && handler.fail && handler.fail();
				}
			}).fail(function() {
				console.log('cancelFollwTopic error');
				handler && handler.fail && handler.fail();
			}).always(function() {
				handler && handler.always && handler.always();
			});
		},
		/**
		 * [followQuestion 关注问题]
		 * @param  {[Number]} id [问题id]
		 * @params  {[Object]} handler [回调]
		 * handler.done {[Function]} [关注成功回调]
		 * handler.fail {[Function]} [关注失败回调]
		 * handler.always {[Function]} [ajax请求执行完成回调]
		 */
		followQuestion: function(id, handler) {
			if (!helper.checkUserStatus({
					checkAuthority: false
				})) {
				handler && handler.fail && handler.fail();
				handler && handler.always && handler.always();
				return;
			}
			helper.ajax({
				url: config.url.followQuestion,
				data: {
					questionId: id
				}
			}).done(function(data) {
				if (data.state == 1) {
					handler && handler.done && handler.done(data);
				} else if (data.state == 304) {
					PASSPORT.loginPopup();
					handler && handler.fail && handler.fail();
				} else if (data.state == 201) {
					helper.alertTips('参数错误');
					handler && handler.fail && handler.fail();
				} else if (data.state == 202) {
					helper.alertTips('不好意思，服务器开了个小差，关注失败！');
					handler && handler.fail && handler.fail();
				} else if (data.state == 203) {
					helper.alertTips('你关注的问题已经不存在了！');
					handler && handler.fail && handler.fail();
				} else if (data.state == 204) {
					helper.alertTips('你已经关注过该问题');
					handler && handler.fail && handler.fail();
				} else if (data.state == 10000) {
					helper.alertTips('没有权限');
					handler && handler.fail && handler.fail();
				} else {
					console.log(data.message);
					handler && handler.fail && handler.fail();
				}
			}).fail(function() {
				console.log('followQuestion error');
				handler && handler.fail && handler.fail();
			}).always(function() {
				handler && handler.always && handler.always();
			});
		},
		/**
		 * [cancelFollwQuestion 取消关注问题]
		 * @param  {[Number]} id [问题id]
		 * @params  {[Object]} handler [回调]
		 * handler.done {[Function]} [取消成功回调]
		 * handler.fail {[Function]} [取消失败回调]
		 * handler.always {[Function]} [ajax请求执行完成回调]
		 */
		cancelFollwQuestion: function(id, handler) {
			if (!helper.checkUserStatus({
					checkAuthority: false
				})) {
				handler && handler.fail && handler.fail();
				handler && handler.always && handler.always();
				return;
			}
			helper.ajax({
				url: config.url.cancelFollowQuestion,
				data: {
					questionId: id
				}
			}).done(function(data) {
				if (data.state == 1) {
					handler && handler.done && handler.done(data);
				} else if (data.state == 304) {
					PASSPORT.loginPopup();
					handler && handler.fail && handler.fail();
				} else if (data.state == 201) {
					helper.alertTips('参数错误');
					handler && handler.fail && handler.fail();
				} else if (data.state == 202) {
					helper.alertTips('不好意思，服务器开了个小差，取消关注问题失败！');
					handler && handler.fail && handler.fail();
				} else if (data.state == 203) {
					helper.alertTips('你取消关注的问题已经不存在了！');
					handler && handler.fail && handler.fail();
				} else if (data.state == 204) {
					helper.alertTips('你已经取消关注过该问题');
					handler && handler.fail && handler.fail();
				} else if (data.state == 10000) {
					helper.alertTips('没有权限');
					handler && handler.fail && handler.fail();
				} else {
					console.log(data.message);
					handler && handler.fail && handler.fail();
				}
			}).fail(function() {
				console.log('cancelFollwQuestion error');
				handler && handler.fail && handler.fail();
			}).always(function() {
				handler && handler.always && handler.always();
			});
		},
		/**
		 * [followUser 关注用户]
		 * @param  {[Number]} id [用户id]
		 * @params  {[Object]} handler [回调]
		 * handler.done {[Function]} [关注成功回调]
		 * handler.fail {[Function]} [关注失败回调]
		 * handler.always {[Function]} [ajax请求执行完成回调]
		 */
		followUser: function(id, handler) {
			if (!helper.checkUserStatus({
					checkAuthority: false
				})) {
				handler && handler.fail && handler.fail();
				handler && handler.always && handler.always();
				return;
			}
			helper.ajax({
				url: config.url.followUser,
				data: {
					targetUserId: id
				}
			}).done(function(data) {
				if (data.state == 1) {
					handler && handler.done && handler.done(data);
				} else if (data.state == 304) {
					PASSPORT.loginPopup();
					handler && handler.fail && handler.fail();
				} else if (data.state == 201) {
					helper.alertTips('参数错误');
					handler && handler.fail && handler.fail();
				} else if (data.state == 202) {
					helper.alertTips('不好意思，服务器开了个小差，关注失败！');
					handler && handler.fail && handler.fail();
				} else if (data.state == 203) {
					helper.alertTips('你关注的用户不存在！');
					handler && handler.fail && handler.fail();
				} else if (data.state == 204) {
					helper.alertTips('你已经关注过该用户');
					handler && handler.fail && handler.fail();
				} else if (data.state == 205) {
					helper.alertTips('你不能关注自己');
					handler && handler.fail && handler.fail();
				} else if (data.state == 10000) {
					helper.alertTips('没有权限');
					handler && handler.fail && handler.fail();
				} else {
					console.log(data.message);
					handler && handler.fail && handler.fail();
				}
			}).fail(function() {
				console.log('followUser error');
				handler && handler.fail && handler.fail();
			}).always(function() {
				handler && handler.always && handler.always();
			});
		},
		/**
		 * [cancelFollowUser 取消关注用户]
		 * @param  {[Number]} id [用户id]
		 * @params  {[Object]} handler [回调]
		 * handler.done {[Function]} [取消成功回调]
		 * handler.fail {[Function]} [取消失败回调]
		 * handler.always {[Function]} [ajax请求执行完成回调]
		 */
		cancelFollowUser: function(id, handler) {
			if (!helper.checkUserStatus({
					checkAuthority: false
				})) {
				handler && handler.fail && handler.fail();
				handler && handler.always && handler.always();
				return;
			}
			helper.ajax({
				url: config.url.cancelFollowUser,
				data: {
					targetUserId: id
				}
			}).done(function(data) {
				if (data.state == 1) {
					handler && handler.done && handler.done(data);
				} else if (data.state == 304) {
					PASSPORT.loginPopup();
					handler && handler.fail && handler.fail();
				} else if (data.state == 201) {
					helper.alertTips('参数错误');
					handler && handler.fail && handler.fail();
				} else if (data.state == 202) {
					helper.alertTips('不好意思，服务器开了个小差，取消关注失败！');
					handler && handler.fail && handler.fail();
				} else if (data.state == 203) {
					helper.alertTips('你取消关注的用户不存在！');
					handler && handler.fail && handler.fail();
				} else if (data.state == 204) {
					helper.alertTips('你已经取消关注过该用户');
					handler && handler.fail && handler.fail();
				} else if (data.state == 10000) {
					helper.alertTips('没有权限');
					handler && handler.fail && handler.fail();
				} else {
					console.log(data.message);
					handler && handler.fail && handler.fail();
				}
			}).fail(function() {
				console.log('cancelFollowUser error');
				handler && handler.fail && handler.fail();
			}).always(function() {
				handler && handler.always && handler.always();
			});
		},
		/**
		 * [addAnswer 回答问题]
		 * @param  {[Object]} data [答案表单数据]
		 * @return  {[Mixed]} undefined或者$.ajax promise
		 */
		addAnswer: function(data) {
			if (Object.prototype.toString.call(data) !== '[object Object]') { // 简单的参数校验
				return;
			}

			return $.lgAjax({
				url: config.url.saveAnswer,
				type: 'POST',
				data: data,
				dataType: 'json'
			}).done(function(data, textStatus, jqXHR) {
				if (parseInt(data.state, 10) === 1) {
					window.location.reload();
				} else if (parseInt(data.state, 10) === 304) {
					PASSPORT.loginPopup();
				} else if (parseInt(data.state, 10) === 208) {
					helper.alertTips('该问题已被管理员关闭！');
				} else if (parseInt(data.state, 10) === 209) {
					helper.alertTips('你已回答该问题！');
				} else if (parseInt(data.state, 10) === 210) {
					helper.alertTips('你最多只能填写10万字的回答！');
				} else if (parseInt(data.state, 10) === 10000) {
					helper.alertTips('在社区内测期间，你还未获得发布内容的权限<br />但这不代表拉勾不爱你，<a href="http://form.mikecrm.com/a1GjwD" target="_blank">获得资格</a>');
				} else {
					helper.alertTips('不好意思，服务器开了个小差，回答问题失败！');
				}
			}).fail(function(jqXHR, textStatus, errorThrown) {
				helper.alertTips('不好意思，服务器开了个小差，回答问题失败！');
			});
		},
		/**
		 * [editAnswer 编辑回答]
		 * @param  {[Object]} data [答案表单数据]
		 * @return  {[Mixed]} undefined或者$.ajax promise
		 */
		editAnswer: function(data) {
			if (Object.prototype.toString.call(data) !== '[object Object]') { // 简单的参数校验
				return;
			}

			return $.lgAjax({
				url: config.url.editAnswer,
				type: 'POST',
				data: data,
				dataType: 'json'
			}).done(function(data, textStatus, jqXHR) {
				if (parseInt(data.state, 10) === 1) {
					window.location.reload();
				} else if (parseInt(data.state, 10) === 304) {
					PASSPORT.loginPopup();
				} else if (parseInt(data.state, 10) === 210) {
					helper.alertTips('你最多只能填写10万字的回答！');
				}  else if (parseInt(data.state, 10) === 999) {
					helper.alertTips(data.message);
				} else if (parseInt(data.state, 10) === 10000) {
					helper.alertTips('你无权执行该操作！');
				} else {
					helper.alertTips('不好意思，服务器开了个小差，编辑答案失败！');
				}
			}).fail(function(jqXHR, textStatus, errorThrown) {
				helper.alertTips('不好意思，服务器开了个小差，编辑答案失败！');
			});
		},
		/**
		 * [alertTips 通用提示框]
		 * @param  {[String]} tips [提示文本]
		 */
		alertTips: function(tips, handler) {
			$.colorbox({
				title: '提示',
				html: '<div class="tipsContent"><p>' + tips + '</p></div>',
				overlayClose: true,
				onClosed: function() {
					handler && handler();
				}
			});
		},
		/**
		 * [checkUserStatus 操作权限校验]
		 * @param {[Object]} option [校验配置]
		 * option.checkLogin {[Boolean]} [登录是否需要校验，默认true]
		 * option.checkActive {[Boolean]} [激活是否需要校验，默认true]
		 * option.checkCompleteInfo {[Boolean]} [完善信息是否需要校验，默认true]
		 * option.checkAuthority {[Boolean]} [白名单是否需要校验，默认true]
		 * @return {[Boolean]} [校验结果]
		 */
		checkUserStatus: function(option) {
			option = option || {};
			option.checkLogin = typeof option.checkLogin == 'boolean' ? option.checkLogin : true;
			option.checkActive = typeof option.checkActive == 'boolean' ? option.checkActive : true;
			option.checkCompleteInfo = typeof option.checkCompleteInfo == 'boolean' ? option.checkCompleteInfo : true;
			option.checkAuthority = typeof option.checkAuthority == 'boolean' ? option.checkAuthority : true;

			if (option.checkLogin && !global.curUserid) { // 用户未登录
				PASSPORT.loginPopup();
				return false;
			}

			if (option.checkActive && !global.curUserIsActive) { // 用户未激活
				document.location.href = GLOBAL_DOMAIN.actx +
					'/account/registerActive.html?callback=' +
					encodeURIComponent(document.location.href);
				return false;
			}

			if (option.checkCompleteInfo && !global.curUserIsCompleteInfo) { // 用户未完善个人信息
				document.location.href = GLOBAL_DOMAIN.zctx + '/';
				return false;
			} else if (option.checkAuthority && !global.curUserIsAuthority) { // 用户未被授权
				helper.alertTips('在社区内测期间，你还未获得发布内容的权限' +
					'<br />' +
					'但这不代表拉勾不爱你，' +
					'<a href="http://form.mikecrm.com/a1GjwD" target="_blank">获得资格</a>');
				return false;
			}

			return true; // 用户状态OK
		}
	};

	exports.helper = helper;

	/**
	 * [analyzeUri 判断是否跨域]
	 * @param  {[String]} url [要判断的url]
	 * @return {[Boolean]}    [判断结果]
	 */
	function analyzeUri(url) {

		/* url匹配正则 */
		var REGEXPURL = /^(https?):\/\/((?:[\u4E00-\u9FA5a-z0-9.-]|%[0-9A-F]{2}){2,})(?::(\d+))?((?:\/(?:[a-z0-9-._~!$&'()*+,;=:@]|%[0-9A-F]{2})*)*)(?:\?((?:[a-z0-9-._~!$&'()*+,;=:\/?@]|%[0-9A-F]{2})*))?(?:#((?:[a-z0-9-._~!$&'()*+,;=:\/?@]|%[0-9A-F]{2})*))?$/i;

		var loc = top.location;
		var origin = {
			protocol: loc.protocol.substring(0, loc.protocol.length - 1),
			hostname: loc.hostname,
			port: loc.port || '80' // 默认80端口
		};

		var targetMatches = REGEXPURL.exec(url);

		// targetMatches不为null，则说明有匹配【需要判断是否跨域】
		// targetMatches如果为null，则说明是不加域名的绝对地址请求，例如：'/a/c.json'【不用跨域】
		if (targetMatches && targetMatches.length) {
			var target = {
				protocol: targetMatches[1],
				hostname: targetMatches[2],
				port: targetMatches[3] || '80'
			};

			// 如果跨域
			if (origin.protocol != target.protocol || origin.hostname != target.hostname || origin.port != target.port) {
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}

	}

	/*function invitation() {
		var lagouCodes = [
			"  __                                         \r\n",
			" /\\ \\                                        \r\n",
			" \\ \\ \\         __       __     ___   __  __  \r\n",
			"  \\ \\ \\  __  /\'__`\\   /\'_ `\\  / __`\\/\\ \\/\\ \\ \r\n",
			"   \\ \\ \\L\\ \\/\\ \\L\\.\\_/\\ \\L\\ \\/\\ \\L\\ \\ \\ \\_\\ \\\r\n",
			"    \\ \\____/\\ \\__/.\\_\\ \\____ \\ \\____/\\ \\____/\r\n",
			"     \\/___/  \\/__/\\/_/\\/___L\\ \\/___/  \\/___/ \r\n",
			"                        /\\____/              \r\n",
			"                        \\_/__/               "
		].join('');

		console.log(lagouCodes);

		console.group('%c你想知道穿山甲到底说了什么吗？看过来看过来→_→https://www.lagou.com/jobs/1869713.html', 'font-size: 16px; font-weight: bold; color: #00b38a;');　　　　
		console.log('我们正在寻找并肩战斗的小伙伴，如果你有兴趣加入我们的前端团队，欢迎把你的简历砸过来');　　　　
		console.log('%cfridayhu@lagou.com fayipan@lagou.com（ 邮件标题请以“姓名-来自console”命名）', 'color: red;');
		console.groupEnd();
	}

	console && invitation();*/

});

/*!community/modules/common/star-rank/main.js*/
;/**
 * 问答社区-红人榜
 * 
 * @author fridayhu@lagou.com
 * 如需设置条数，在引入模块html文件时，需在页面中添加如下隐藏域,默认显示5条
 * <input type="hidden" name="starRankListNum" id="starRankListNum" value="5" />
 * 
 */
define('community/modules/common/star-rank/main', ['require', 'exports', 'module', 'community/modules/common/main', 'dep/artTemplate/dist/template'], function(require, exports, module) {

	var config = require('community/modules/common/main').config,
		helper = require('community/modules/common/main').helper;
	var template = require('dep/artTemplate/dist/template');

	$('#starRank .star_rank_loading').show();

	var pageSize = $('#starRankListNum').val() || 5;

	// 加载红人榜
	helper.ajax({
		url: config.url.getStarRank,
		data: {
			"pageNo": 1,
			"pageSize": pageSize
		}
	}).done(function(data) {
		if (data.state == 1 && data.content.data) {
			var tpl = "{{each starRankList as user index}}\n\t<li>\n\t\t<div class=\"avatar fl\" data-rank=\"rank{{index}}\">\n\t\t\t<a href=\"{{FE_zbase}}/user/userIndex-{{user.id}}.html\" target=\"_blank\" data-lg-tj-id=\"1cc0\" data-lg-tj-no=\"00{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{user.id}}\">\n\t\t\t\t{{if user.portrait && user.portrait != ''}}\n\t\t\t\t<img src=\"{{FE_lgsbase}}/{{user.portrait}}\" width=\"40\" height=\"40\" alt=\"{{user.userName}}\" />\n\t\t\t\t{{else}}\n\t\t\t\t<img src=\"//www.lgstatic.com/lg-community-fed/community/modules/common/img/avatar_default_7225407.png\" width=\"40\" height=\"40\" alt=\"{{user.userName}}\" />\n\t\t\t\t{{/if}}\n\t\t\t</a>\n\t\t</div>\n\t\t<div class=\"userinfo_box user_name\">\n\t\t\t<a href=\"{{FE_zbase}}/user/userIndex-{{user.id}}.html\" target=\"_blank\" data-lg-tj-id=\"1cd0\" data-lg-tj-no=\"00{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{user.id}}\">{{user.userName}}</a>\n\t\t</div>\n\t\t<div class=\"userinfo_box user_recent_star\">\n\t\t\t<a href=\"{{FE_zbase}}/user/userIndex-{{user.id}}.html\" title=\"7天内获得{{user.rakingStarNum}}个赞\" target=\"_blank\" data-lg-tj-id=\"1aH0\" data-lg-tj-no=\"00{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{user.id}}\"><em>{{user.rakingStarNum}}</em> 赞</a>\n\t\t</div>\n\t</li>\n{{/each}}\n";
			var htmlStr = template.compile(tpl)({
				starRankList: data.content.data.rankingList,
				FE_base: GLOBAL_DOMAIN.ctx,
				FE_zbase: GLOBAL_DOMAIN.zctx,
				FE_lgsbase: GLOBAL_DOMAIN.lgsctx,
				cdndomain: window.GLOBAL_CDN_DOMAIN
			});
			$('#starRank ul.list').empty().append(htmlStr);
			if (!data.content.data.rankingList || data.content.data.rankingList.length < 1) {
				$('#starRank').hide();
			}
		} else {
			console.log(data.message);
			$('#starRank').hide();
		}
	}).fail(function() {
		console.log('getRecommendedQuestion error');
		$('#starRank').hide();
	}).always(function() {
		$('#starRank .star_rank_loading').hide();
	});

});

/*!dep/jQuery.dotdotdot/src/jquery.dotdotdot.js*/
;define('dep/jQuery.dotdotdot/src/jquery.dotdotdot', ['require', 'exports', 'module'], function(require, exports, module) {

  /*
   *	jQuery dotdotdot 1.8.0
   *
   *	Copyright (c) Fred Heusschen
   *	www.frebsite.nl
   *
   *	Plugin website:
   *	dotdotdot.frebsite.nl
   *
   *	Licensed under the MIT license.
   *	http://en.wikipedia.org/wiki/MIT_License
   */
  
  (function( $, undef )
  {
  	if ( $.fn.dotdotdot )
  	{
  		return;
  	}
  
  	$.fn.dotdotdot = function( o )
  	{
  		if ( this.length == 0 )
  		{
  			$.fn.dotdotdot.debug( 'No element found for "' + this.selector + '".' );
  			return this;
  		}
  		if ( this.length > 1 )
  		{
  			return this.each(
  				function()
  				{
  					$(this).dotdotdot( o );
  				}
  			);
  		}
  
  
  		var $dot = this;
  		var orgContent	= $dot.contents();
  
  		if ( $dot.data( 'dotdotdot' ) )
  		{
  			$dot.trigger( 'destroy.dot' );
  		}
  
  		$dot.data( 'dotdotdot-style', $dot.attr( 'style' ) || '' );
  		$dot.css( 'word-wrap', 'break-word' );
  		if ($dot.css( 'white-space' ) === 'nowrap')
  		{
  			$dot.css( 'white-space', 'normal' );
  		}
  
  		$dot.bind_events = function()
  		{
  			$dot.bind(
  				'update.dot',
  				function( e, c )
  				{
  					$dot.removeClass("is-truncated");
  					e.preventDefault();
  					e.stopPropagation();
  
  					switch( typeof opts.height )
  					{
  						case 'number':
  							opts.maxHeight = opts.height;
  							break;
  
  						case 'function':
  							opts.maxHeight = opts.height.call( $dot[ 0 ] );
  							break;
  
  						default:
  							opts.maxHeight = getTrueInnerHeight( $dot );
  							break;
  					}
  
  					opts.maxHeight += opts.tolerance;
  
  					if ( typeof c != 'undefined' )
  					{
  						if ( typeof c == 'string' || ('nodeType' in c && c.nodeType === 1) )
  						{
  					 		c = $('<div />').append( c ).contents();
  						}
  						if ( c instanceof $ )
  						{
  							orgContent = c;
  						}
  					}
  
  					$inr = $dot.wrapInner( '<div class="dotdotdot" />' ).children();
  					$inr.contents()
  						.detach()
  						.end()
  						.append( orgContent.clone( true ) )
  						.find( 'br' )
  						.replaceWith( '  <br />  ' )
  						.end()
  						.css({
  							'height'	: 'auto',
  							'width'		: 'auto',
  							'border'	: 'none',
  							'padding'	: 0,
  							'margin'	: 0
  						});
  
  					var after = false,
  						trunc = false;
  
  					if ( conf.afterElement )
  					{
  						after = conf.afterElement.clone( true );
  					    after.show();
  						conf.afterElement.detach();
  					}
  
  					if ( test( $inr, opts ) )
  					{
  						if ( opts.wrap == 'children' )
  						{
  							trunc = children( $inr, opts, after );
  						}
  						else
  						{
  							trunc = ellipsis( $inr, $dot, $inr, opts, after );
  						}
  					}
  					$inr.replaceWith( $inr.contents() );
  					$inr = null;
  
  					if ( $.isFunction( opts.callback ) )
  					{
  						opts.callback.call( $dot[ 0 ], trunc, orgContent );
  					}
  
  					conf.isTruncated = trunc;
  					return trunc;
  				}
  
  			).bind(
  				'isTruncated.dot',
  				function( e, fn )
  				{
  					e.preventDefault();
  					e.stopPropagation();
  
  					if ( typeof fn == 'function' )
  					{
  						fn.call( $dot[ 0 ], conf.isTruncated );
  					}
  					return conf.isTruncated;
  				}
  
  			).bind(
  				'originalContent.dot',
  				function( e, fn )
  				{
  					e.preventDefault();
  					e.stopPropagation();
  
  					if ( typeof fn == 'function' )
  					{
  						fn.call( $dot[ 0 ], orgContent );
  					}
  					return orgContent;
  				}
  
  			).bind(
  				'destroy.dot',
  				function( e )
  				{
  					e.preventDefault();
  					e.stopPropagation();
  
  					$dot.unwatch()
  						.unbind_events()
  						.contents()
  						.detach()
  						.end()
  						.append( orgContent )
  						.attr( 'style', $dot.data( 'dotdotdot-style' ) || '' )
  						.removeClass( 'is-truncated' )
  						.data( 'dotdotdot', false );
  				}
  			);
  			return $dot;
  		};	//	/bind_events
  
  		$dot.unbind_events = function()
  		{
  			$dot.unbind('.dot');
  			return $dot;
  		};	//	/unbind_events
  
  		$dot.watch = function()
  		{
  			$dot.unwatch();
  			if ( opts.watch == 'window' )
  			{
  				var $window = $(window),
  					_wWidth = $window.width(),
  					_wHeight = $window.height();
  
  				$window.bind(
  					'resize.dot' + conf.dotId,
  					function()
  					{
  						if ( _wWidth != $window.width() || _wHeight != $window.height() || !opts.windowResizeFix )
  						{
  							_wWidth = $window.width();
  							_wHeight = $window.height();
  
  							if ( watchInt )
  							{
  								clearInterval( watchInt );
  							}
  							watchInt = setTimeout(
  								function()
  								{
  									$dot.trigger( 'update.dot' );
  								}, 100
  							);
  						}
  					}
  				);
  			}
  			else
  			{
  				watchOrg = getSizes( $dot );
  				watchInt = setInterval(
  					function()
  					{
  						if ( $dot.is( ':visible' ) )
  						{
  							var watchNew = getSizes( $dot );
  							if ( watchOrg.width  != watchNew.width ||
  								 watchOrg.height != watchNew.height )
  							{
  								$dot.trigger( 'update.dot' );
  								watchOrg = watchNew;
  							}
  						}
  					}, 500
  				);
  			}
  			return $dot;
  		};
  		$dot.unwatch = function()
  		{
  			$(window).unbind( 'resize.dot' + conf.dotId );
  			if ( watchInt )
  			{
  				clearInterval( watchInt );
  			}
  			return $dot;
  		};
  
  		var	opts 		= $.extend( true, {}, $.fn.dotdotdot.defaults, o ),
  			conf		= {},
  			watchOrg	= {},
  			watchInt	= null,
  			$inr		= null;
  
  
  		if ( !( opts.lastCharacter.remove instanceof Array ) )
  		{
  			opts.lastCharacter.remove = $.fn.dotdotdot.defaultArrays.lastCharacter.remove;
  		}
  		if ( !( opts.lastCharacter.noEllipsis instanceof Array ) )
  		{
  			opts.lastCharacter.noEllipsis = $.fn.dotdotdot.defaultArrays.lastCharacter.noEllipsis;
  		}
  
  
  		conf.afterElement	= getElement( opts.after, $dot );
  		conf.isTruncated	= false;
  		conf.dotId			= dotId++;
  
  
  		$dot.data( 'dotdotdot', true )
  			.bind_events()
  			.trigger( 'update.dot' );
  
  		if ( opts.watch )
  		{
  			$dot.watch();
  		}
  
  		return $dot;
  	};
  
  
  	//	public
  	$.fn.dotdotdot.defaults = {
  		'ellipsis'			: '... ',
  		'wrap'				: 'word',
  		'fallbackToLetter'	: true,
  		'lastCharacter'		: {},
  		'tolerance'			: 0,
  		'callback'			: null,
  		'after'				: null,
  		'height'			: null,
  		'watch'				: false,
  		'windowResizeFix'	: true
  	};
  	$.fn.dotdotdot.defaultArrays = {
  		'lastCharacter'		: {
  			'remove'			: [ ' ', '\u3000', ',', ';', '.', '!', '?' ],
  			'noEllipsis'		: []
  		}
  	};
  	$.fn.dotdotdot.debug = function( msg ) {};
  
  
  	//	private
  	var dotId = 1;
  
  	function children( $elem, o, after )
  	{
  		var $elements 	= $elem.children(),
  			isTruncated	= false;
  
  		$elem.empty();
  
  		for ( var a = 0, l = $elements.length; a < l; a++ )
  		{
  			var $e = $elements.eq( a );
  			$elem.append( $e );
  			if ( after )
  			{
  				$elem.append( after );
  			}
  			if ( test( $elem, o ) )
  			{
  				$e.remove();
  				isTruncated = true;
  				break;
  			}
  			else
  			{
  				if ( after )
  				{
  					after.detach();
  				}
  			}
  		}
  		return isTruncated;
  	}
  	function ellipsis( $elem, $d, $i, o, after )
  	{
  		var isTruncated	= false;
  
  		//	Don't put the ellipsis directly inside these elements
  		var notx = 'a, table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, blockquote, select, optgroup, option, textarea, script, style';
  
  		//	Don't remove these elements even if they are after the ellipsis
  		var noty = 'script, .dotdotdot-keep';
  
  		$elem
  			.contents()
  			.detach()
  			.each(
  				function()
  				{
  
  					var e	= this,
  						$e	= $(e);
  
  					if ( typeof e == 'undefined' )
  					{
  						return true;
  					}
  					else if ( $e.is( noty ) )
  					{
  						$elem.append( $e );
  					}
  					else if ( isTruncated )
  					{
  						return true;
  					}
  					else
  					{
  						$elem.append( $e );
  						if ( after && !$e.is( o.after ) && !$e.find( o.after ).length  )
  						{
  							$elem[ $elem.is( notx ) ? 'after' : 'append' ]( after );
  						}
  						if ( test( $i, o ) )
  						{
  							if ( e.nodeType == 3 ) // node is TEXT
  							{
  								isTruncated = ellipsisElement( $e, $d, $i, o, after );
  							}
  							else
  							{
  								isTruncated = ellipsis( $e, $d, $i, o, after );
  							}
  						}
  
  						if ( !isTruncated )
  						{
  							if ( after )
  							{
  								after.detach();
  							}
  						}
  					}
  				}
  			);
  		$d.addClass("is-truncated");
  		return isTruncated;
  	}
  	function ellipsisElement( $e, $d, $i, o, after )
  	{
  		var e = $e[ 0 ];
  
  		if ( !e )
  		{
  			return false;
  		}
  
  		var txt			= getTextContent( e ),
  			space		= ( txt.indexOf(' ') !== -1 ) ? ' ' : '\u3000',
  			separator	= ( o.wrap == 'letter' ) ? '' : space,
  			textArr		= txt.split( separator ),
  			position 	= -1,
  			midPos		= -1,
  			startPos	= 0,
  			endPos		= textArr.length - 1;
  
  
  		//	Only one word
  		if ( o.fallbackToLetter && startPos == 0 && endPos == 0 )
  		{
  			separator	= '';
  			textArr		= txt.split( separator );
  			endPos		= textArr.length - 1;
  		}
  
  		while ( startPos <= endPos && !( startPos == 0 && endPos == 0 ) )
  		{
  			var m = Math.floor( ( startPos + endPos ) / 2 );
  			if ( m == midPos )
  			{
  				break;
  			}
  			midPos = m;
  
  			setTextContent( e, textArr.slice( 0, midPos + 1 ).join( separator ) + o.ellipsis );
  			$i.children()
  				.each(
  					function()
  					{
  						$(this).toggle().toggle();
  					}
  				);
  
  			if ( !test( $i, o ) )
  			{
  				position = midPos;
  				startPos = midPos;
  			}
  			else
  			{
  				endPos = midPos;
  
  				//	Fallback to letter
  				if (o.fallbackToLetter && startPos == 0 && endPos == 0 )
  				{
  					separator	= '';
  					textArr		= textArr[ 0 ].split( separator );
  					position	= -1;
  					midPos		= -1;
  					startPos	= 0;
  					endPos		= textArr.length - 1;
  				}
  			}
  		}
  
  		if ( position != -1 && !( textArr.length == 1 && textArr[ 0 ].length == 0 ) )
  		{
  			txt = addEllipsis( textArr.slice( 0, position + 1 ).join( separator ), o );
  			setTextContent( e, txt );
  		}
  		else
  		{
  			var $w = $e.parent();
  			$e.detach();
  
  			var afterLength = ( after && after.closest($w).length ) ? after.length : 0;
  
  			if ( $w.contents().length > afterLength )
  			{
  				e = findLastTextNode( $w.contents().eq( -1 - afterLength ), $d );
  			}
  			else
  			{
  				e = findLastTextNode( $w, $d, true );
  				if ( !afterLength )
  				{
  					$w.detach();
  				}
  			}
  			if ( e )
  			{
  				txt = addEllipsis( getTextContent( e ), o );
  				setTextContent( e, txt );
  				if ( afterLength && after )
  				{
  					$(e).parent().append( after );
  				}
  			}
  		}
  
  		return true;
  	}
  	function test( $i, o )
  	{
  		return $i.innerHeight() > o.maxHeight;
  	}
  	function addEllipsis( txt, o )
  	{
  		while( $.inArray( txt.slice( -1 ), o.lastCharacter.remove ) > -1 )
  		{
  			txt = txt.slice( 0, -1 );
  		}
  		if ( $.inArray( txt.slice( -1 ), o.lastCharacter.noEllipsis ) < 0 )
  		{
  			txt += o.ellipsis;
  		}
  		return txt;
  	}
  	function getSizes( $d )
  	{
  		return {
  			'width'	: $d.innerWidth(),
  			'height': $d.innerHeight()
  		};
  	}
  	function setTextContent( e, content )
  	{
  		if ( e.innerText )
  		{
  			e.innerText = content;
  		}
  		else if ( e.nodeValue )
  		{
  			e.nodeValue = content;
  		}
  		else if (e.textContent)
  		{
  			e.textContent = content;
  		}
  
  	}
  	function getTextContent( e )
  	{
  		if ( e.innerText )
  		{
  			return e.innerText;
  		}
  		else if ( e.nodeValue )
  		{
  			return e.nodeValue;
  		}
  		else if ( e.textContent )
  		{
  			return e.textContent;
  		}
  		else
  		{
  			return "";
  		}
  	}
  	function getPrevNode( n )
  	{
  		do
  		{
  			n = n.previousSibling;
  		}
  		while ( n && n.nodeType !== 1 && n.nodeType !== 3 );
  
  		return n;
  	}
  	function findLastTextNode( $el, $top, excludeCurrent )
  	{
  		var e = $el && $el[ 0 ], p;
  		if ( e )
  		{
  			if ( !excludeCurrent )
  			{
  				if ( e.nodeType === 3 )
  				{
  					return e;
  				}
  				if ( $.trim( $el.text() ) )
  				{
  					return findLastTextNode( $el.contents().last(), $top );
  				}
  			}
  			p = getPrevNode( e );
  			while ( !p )
  			{
  				$el = $el.parent();
  				if ( $el.is( $top ) || !$el.length )
  				{
  					return false;
  				}
  				p = getPrevNode( $el[0] );
  			}
  			if ( p )
  			{
  				return findLastTextNode( $(p), $top );
  			}
  		}
  		return false;
  	}
  	function getElement( e, $i )
  	{
  		if ( !e )
  		{
  			return false;
  		}
  		if ( typeof e === 'string' )
  		{
  			e = $(e, $i);
  			return ( e.length )
  				? e
  				: false;
  		}
  		return !e.jquery
  			? false
  			: e;
  	}
  	function getTrueInnerHeight( $el )
  	{
  		var h = $el.innerHeight(),
  			a = [ 'paddingTop', 'paddingBottom' ];
  
  		for ( var z = 0, l = a.length; z < l; z++ )
  		{
  			var m = parseInt( $el.css( a[ z ] ), 10 );
  			if ( isNaN( m ) )
  			{
  				m = 0;
  			}
  			h -= m;
  		}
  		return h;
  	}
  
  
  	//	override jQuery.html
  	var _orgHtml = $.fn.html;
  	$.fn.html = function( str )
  	{
  		if ( str != undef && !$.isFunction( str ) && this.data( 'dotdotdot' ) )
  		{
  			return this.trigger( 'update', [ str ] );
  		}
  		return _orgHtml.apply( this, arguments );
  	};
  
  
  	//	override jQuery.text
  	var _orgText = $.fn.text;
  	$.fn.text = function( str )
  	{
  		if ( str != undef && !$.isFunction( str ) && this.data( 'dotdotdot' ) )
  		{
  			str = $( '<div />' ).text( str ).html();
  			return this.trigger( 'update', [ str ] );
  		}
  		return _orgText.apply( this, arguments );
  	};
  
  
  })( jQuery );
  
  /*
  
  ## Automatic parsing for CSS classes
  Contributed by [Ramil Valitov](https://github.com/rvalitov)
  
  ### The idea
  You can add one or several CSS classes to HTML elements to automatically invoke "jQuery.dotdotdot functionality" and some extra features. It allows to use jQuery.dotdotdot only by adding appropriate CSS classes without JS programming.
  
  ### Available classes and their description
  * dot-ellipsis - automatically invoke jQuery.dotdotdot to this element. This class must be included if you plan to use other classes below.
  * dot-resize-update - automatically update if window resize event occurs. It's equivalent to option `watch:'window'`.
  * dot-timer-update - automatically update if window resize event occurs. It's equivalent to option `watch:true`.
  * dot-load-update - automatically update after the window has beem completely rendered. Can be useful if your content is generated dynamically using using JS and, hence, jQuery.dotdotdot can't correctly detect the height of the element before it's rendered completely.
  * dot-height-XXX - available height of content area in pixels, where XXX is a number, e.g. can be `dot-height-35` if you want to set maximum height for 35 pixels. It's equivalent to option `height:'XXX'`.
  
  ### Usage examples
  *Adding jQuery.dotdotdot to element*
      
  	<div class="dot-ellipsis">
  	<p>Lorem Ipsum is simply dummy text.</p>
  	</div>
  	
  *Adding jQuery.dotdotdot to element with update on window resize*
      
  	<div class="dot-ellipsis dot-resize-update">
  	<p>Lorem Ipsum is simply dummy text.</p>
  	</div>
  	
  *Adding jQuery.dotdotdot to element with predefined height of 50px*
      
  	<div class="dot-ellipsis dot-height-50">
  	<p>Lorem Ipsum is simply dummy text.</p>
  	</div>
  	
  */
  
  jQuery(document).ready(function($) {
  	//We only invoke jQuery.dotdotdot on elements that have dot-ellipsis class
  	$(".dot-ellipsis").each(function(){
  		//Checking if update on window resize required
  		var watch_window=$(this).hasClass("dot-resize-update");
  		
  		//Checking if update on timer required
  		var watch_timer=$(this).hasClass("dot-timer-update");
  		
  		//Checking if height set
  		var height=0;		
  		var classList = $(this).attr('class').split(/\s+/);
  		$.each(classList, function(index, item) {
  			if (!item.match('/^dot\-height\-\d+$/')) {
  				height=Number(item.substr(item.indexOf('-',-1)+1));
  			}
  		});
  		
  		//Invoking jQuery.dotdotdot
  		var x = new Object();
  		if (watch_timer)
  			x.watch=true;
  		if (watch_window)
  			x.watch='window';
  		if (height>0)
  			x.height=height;
  		$(this).dotdotdot(x);
  	});
  		
  });
  
  //Updating elements (if any) on window.load event
  jQuery(window).load(function(){
  	jQuery(".dot-ellipsis.dot-load-update").trigger("update.dot");
  });

});
/*!community/modules/common/new-question-btn/main.js*/
;/**
 * 问答社区-提个问题按钮
 * 在要添加提问弹窗的标签上添加类名 new_question_btn 即可使用
 * 如需添加默认话题在标签上添加自定义属性 data-topic-id="topicId" data-topic-name="name" [data-is-company-topic="1"]
 * data-topic-id="topicId"
 * （目前暂无话题、问题查询接口，所以现在data-topic-id和data-topic-name都需要设置,如果是公司话题的话要设置data-is-company-topic）
 * @param data-topic-id [话题ID]
 * @param data-topic-name [话题名]
 * @param [data-is-company-topic] [是否是公司话题,如果是值为1]
 * 
 * @author fridayhu@lagou.com
 *
 * jquery-colorbox
 * @require "common/components/jquery-colorbox-custom/jquery-colorbox.css"
 *
 * @require "community/modules/common/new-question-btn/main.less"
 * 
 */

define('community/modules/common/new-question-btn/main', ['require', 'exports', 'module', 'dep/jquery-colorbox/jquery.colorbox', 'community/modules/common/main', 'dep/artTemplate/dist/template'], function(require, exports, module) {

	require('dep/jquery-colorbox/jquery.colorbox');
	var config = require('community/modules/common/main').config,
		helper = require('community/modules/common/main').helper;
	var template = require('dep/artTemplate/dist/template');
	// 默认设置
	var defaultSettings = {
		maxTopicsNum: 3
	};

	// 初始化
	(function init() {
		$('#newQuestionPopupWrap').size() < 1 && $('body').append('<div class="new_question_popup_wrap" id="newQuestionPopupWrap"></div>');

		// 绑定弹窗
		$('body').on('click', '.new_question_btn', function(e) {
			if (!helper.checkUserStatus()) {
				return;
			}

			$this = $(this);

			// 弹窗
			if ($('#newQuestionPopupBox').size() > 0) {
				resetPopup();
				questionPopup();
				return;
			} else {

				// 获取向谁提问数据并初始化弹窗
				var targetDataReady = false,
					targetList = [];

				helper.ajax({
					url: config.url.getAskToList
				}).done(function(data) {
					if (data.state == 1 && data.content.data) {
						targetList = data.content.data.askToList;
					} else {
						console.log(data.message);
					}
				}).fail(function() {
					console.log('getAskToList error');
				}).always(function() {
					// 初始化弹窗
					initPopup({
						defaultTopicId: $this.attr('data-topic-id'),
						defaultTopicName: $this.attr('data-topic-name'),
						defaultIsCompanyTopic: $this.attr('data-is-company-topic'),
						targetList: targetList
					});
					targetDataReady = true;
				});
			}

		});

	})();


	// 弹窗
	function questionPopup() {
		$.colorbox({
			inline: true,
			href: $('#newQuestionPopupBox'),
			title: '提个问题',
			close: '<a class="popupTjPlaceholder" data-lg-tj-id="1na0" data-lg-tj-no="idnull" data-lg-tj-cid="idnull">close</a>'
				/*,
				onComplete: function() {
					$('#cboxLoadedContent, #cboxContent, #cboxWrapper, #colorbox').css('overflow', 'visible');
				}*/
		});

	}

	// 重置弹窗
	function resetPopup() {
		$('#newQuestionPopupBox .topic_selected_list').empty();
		addTopicSelected(defaultSettings.defaultTopicId, defaultSettings.defaultTopicName, defaultSettings.defaultIsCompanyTopic);
		updateTopicSelected();
		hideAutoCompleteQuestion();
		hideAutoCompleteTopic();
		$('#newQuestionForm').get(0).reset();
		autoFillLocalStorage();
		updatePlaceholder();
		submitCheck();

	}

	// 初始化弹窗
	var initPopupComplete = false;

	function initPopup(config) {
		if (initPopupComplete) {
			return;
		}
		initPopupComplete = true;

		var targetList = config.targetList;

		// 添加弹窗结构
		var tpl = "<div class=\"new_question_popup_box\" id=\"newQuestionPopupBox\">\n    <form id=\"newQuestionForm\" action=\"$!{FE_zbase}/user/saveInfo.json\" method=\"post\">\n        <dl class=\"form_list clearfix\">\n            <dt class=\"label_title\"><label for=\"newQuestioninputTitle\"><i>*</i>问题</label></dt>\n            <dd class=\"new_question_title\">\n                <div class=\"input_box\">\n                    <input type=\"text\" id=\"newQuestioninputTitle\" name=\"title\" placeholder=\"请一句话描述问题，并以问号结尾\" autocomplete=\"off\" maxlength=\"50\" data-maxlength=\"50\" />\n                </div>\n                <div class=\"question_autoComplete_box\">\n                    <div class=\"question_autoComplete_list\">\n                        <ul></ul>\n                    </div>\n                </div>\n            </dd>\n            <dt class=\"label_content\"><label for=\"newQuestioninputContent\">问题补充</label></dt>\n            <dd class=\"new_question_content\">\n                <div class=\"input_box\">\n                    <textarea id=\"newQuestioninputContent\" name=\"content\" placeholder=\"请详细介绍问题，认真的提问才能带来专业的回答哦 建议补充以下信息： 1、问题发生的背景 2、最大的困扰是什么 3、问题相关数据是什么\" maxlength=\"500\" data-maxlength=\"500\"></textarea>\n                    <div class=\"input_placeholder\">\n                        请详细介绍问题，认真的提问才能带来专业的回答哦<br />\n                        建议补充以下信息：<br />\n                        1、问题发生的背景<br />\n                        2、最大的困扰是什么<br />\n                        3、问题相关数据是什么\n                    </div>\n                </div>\n            </dd>\n            <dt class=\"label_belongTopicIds\">\n                <label for=\"newQuestionTopicSearch\"><i>*</i>所属话题</label>\n                <br />\n                <span>（<em class=\"topic_selected_num\">{{selectedTopicsNum}}</em>/<em class=\"topic_selectable_num\">{{maxTopicsNum}}</em>）</span>\n            </dt>\n            <dd class=\"new_question_belongTopicIds\">\n                <div class=\"input_box\">\n                    <ul class=\"topic_selected_list fl\"></ul>\n                    <div class=\"topic_search\">\n                        <input type=\"text\" id=\"newQuestionTopicSearch\" placeholder=\"搜索已有话题\" autocomplete=\"off\" maxlength=\"50\" />\n                    </div>\n                </div>\n                <p class=\"tips\">给问题添加话题有助于更快获得解答</p>\n                <div class=\"topic_autoComplete_box\">\n                    <div class=\"topic_autoComplete_list\">\n                        <ul></ul>\n                    </div>\n                    <a class=\"topic_autoComplete_new_btn\" href=\"javascript:;\" data-lg-tj-id=\"1gn0\" data-lg-tj-no=\"idnull\" data-lg-tj-cid=\"idnull\"><i>+</i>创建该话题</a>\n                </div>\n            </dd>\n            {{if targetList.length > 0}}\n            <dt class=\"label_askToIds\"><label for=\"\">向谁提问</label></dt>\n            <dd class=\"new_question_askToIds\">\n                <ul class=\"target_list\">\n                    {{each targetList as item index}}\n                        <li><input type=\"checkbox\" id=\"targetListAskToIds{{item.id}}\" name=\"askToIds\" value=\"{{item.id}}\"><label for=\"targetListAskToIds{{item.id}}\">{{item.name}}</label></li>\n                    {{/each}}\n                </ul>\n            </dd>\n            {{/if}}\n        </dl>\n        <div class=\"new_question_toolbar\">\n            <a class=\"btn new_question_submit\" id=\"newQuestionSubmit\" href=\"javascript:;\" data-lg-tj-id=\"1c10\" data-lg-tj-no=\"idnull\" data-lg-tj-cid=\"idnull\">发布问题</a>\n            <input type=\"checkbox\" class=\"new_question_enable_anonymous magic-checkbox\" id=\"newQuestionEnableAnonymous\" name=\"anonymous\" />\n            <label for=\"newQuestionEnableAnonymous\" data-lg-tj-id=\"1c20\" data-lg-tj-no=\"idnull\" data-lg-tj-cid=\"idnull\">匿名提问</label>\n            <input type=\"hidden\" id=\"newQuestionSource\" name=\"source\" value=\"PC\">\n        </div>\n    </form>\n</div>\n";
		var htmlStr = template.compile(tpl)({
			targetList: targetList,
			selectedTopicsNum: 0,
			maxTopicsNum: defaultSettings.maxTopicsNum,
			FE_zbase: GLOBAL_DOMAIN.zctx,
			FE_lgsbase: GLOBAL_DOMAIN.lgsctx,
			cdndomain: window.GLOBAL_CDN_DOMAIN
		});
		$('#newQuestionPopupWrap').append(htmlStr);

		// newQuestioninputContent placeholder换行
		// $('#newQuestioninputContent').prop('placeholder', '请详细介绍问题，认真的提问才能带来专业的回答哦\n建议补充以下信息：\n1、问题发生的背景\n2、最大的困扰是什么\n3、问题相关数据是什么');

		// 添加输入框的focus、blur效果
		$('#newQuestionPopupBox .input_box').on('focus', 'input, textarea', function(e) {
			$(this).closest('.input_box').addClass('focus');
		});
		$('#newQuestionPopupBox .input_box').on('blur', 'input, textarea', function(e) {
			$(this).closest('.input_box').removeClass('focus');
		});
		$('#newQuestionPopupBox').on('click', '.new_question_belongTopicIds .topic_selected_list', function(e) {
			// 此处按精确位置绑定事件，防止因为input_box内部子元素事件穿透误触发，e.isTrigger??
			$('#newQuestionTopicSearch').focus();
		});
		// 删除话题标签事件绑定
		$('#newQuestionPopupBox .topic_selected_list').on('click', 'li i', function(e) {
			deleteTopicSelected($(this).siblings('input[name=belongTopicIds]').val(), function() {
				$('#newQuestionTopicSearch').focus();
				hideAutoCompleteTopic();
			});
			e.stopPropagation();
		});
		// 添加话题标签事件绑定
		$('#newQuestionPopupBox .topic_autoComplete_list').on('click', 'li', function(e) {
			addTopicSelected($(this).attr('data-topic-id'), $(this).attr('data-topic-name'), $(this).attr('data-is-company-topic'), function() {
				$('#newQuestionTopicSearch').focus();
				hideAutoCompleteTopic();
			});
			e.stopPropagation();
		});
		// 创建话题事件绑定
		$('#newQuestionPopupBox .topic_autoComplete_box').on('click', '.topic_autoComplete_new_btn', function(e) {
			createTopic($('#newQuestionTopicSearch').val(), false, function() {
				$('#newQuestionTopicSearch').focus();
				hideAutoCompleteTopic();
			});
			e.stopPropagation();
		});
		// 点击外部隐藏搜索提示框
		$('#newQuestionPopupBox').on('click', function(e) {
			hideAutoCompleteQuestion();
			hideAutoCompleteTopic();
		});
		$('#newQuestionPopupBox').on('click', '.label_title label, .new_question_title', function(e) {
			hideAutoCompleteTopic();
			e.stopPropagation();
		});
		$('#newQuestionPopupBox').on('click', '.label_belongTopicIds label, .new_question_belongTopicIds', function(e) {
			hideAutoCompleteQuestion();
			e.stopPropagation();
		});

		// 本地保存延迟 时间单位ms
		var autoSaveLocalDelay = 200;
		lastAutoSaveLocal = 0;

		// 搜索提示延迟 时间单位ms
		var autoCompleteDelay = 200,
			autoCompleteOnFocusDelay = 2000,
			// 最后一次搜索输入的时间戳 
			lastAutoComplete = 0;

		// 搜索问题 && 本地保存
		$('#newQuestioninputTitle').on('keyup', function(e) {
			e.which == 38 && prevAutoQuestion();
			e.which == 40 && nextAutoQuestion();
			e.which == 13 && enterAutoQuestion();
			// 不改变输入的按键
			if (e.which == 13 || e.which >= 37 && e.which <= 40) {
				return;
			}

			// console.log(e.timeStamp);
			// 记录最后一次keyup事件时间
			lastAutoComplete = e.timeStamp;
			setTimeout(function() {
				// 如果延时设定内没有再次发生keyup事件
				if (lastAutoComplete - e.timeStamp == 0) {
					var questionTitle = $('#newQuestioninputTitle').val();
					autoCompleteQuestion(questionTitle);
				}
			}, autoCompleteDelay);
			// 记录最后一次keyup事件时间
			lastAutoSaveLocal = e.timeStamp;
			setTimeout(function() {
				// 如果延时设定内没有再次发生keyup事件
				if (lastAutoSaveLocal - e.timeStamp == 0) {
					var questionTitle = $('#newQuestioninputTitle').val() || '';
					try {
						window.localStorage && (function() {
							localStorage.autoSaveQuestionTitle = questionTitle
						})();
					} catch (err) {
						console.log('auto save questionTitle fail');
					}
				}
			}, autoSaveLocalDelay);

		});
		$('#newQuestioninputTitle').on('focus', function(e) {
			// console.log(e.timeStamp - lastAutoComplete);
			if (e.timeStamp - lastAutoComplete > autoCompleteOnFocusDelay) {
				lastAutoComplete = e.timeStamp;
				var questionTitle = $('#newQuestioninputTitle').val();
				autoCompleteQuestion(questionTitle);
			}
		});

		// 问题补充本地保存
		$('#newQuestioninputContent').on('keyup', function(e) {
			// 不改变输入的按键
			if (e.which == 13 || e.which >= 37 && e.which <= 40) {
				return;
			}

			// 记录最后一次keyup事件时间
			lastAutoSaveLocal = e.timeStamp;
			setTimeout(function() {
				// 如果延时设定内没有再次发生keyup事件
				if (lastAutoSaveLocal - e.timeStamp == 0) {
					var questionContent = $('#newQuestioninputContent').val() || '';
					try {
						window.localStorage && (function() {
							localStorage.autoSaveQuestionContent = questionContent
						})();
					} catch (err) {
						console.log('auto save questionContent fail');
					}
				}
			}, autoSaveLocalDelay);

		});
		// 搜索话题
		$('#newQuestionTopicSearch').on('keyup', function(e) {
			e.which == 38 && prevAutoTopic();
			e.which == 40 && nextAutoTopic();
			e.which == 13 && enterAutoTopic();
			// 不改变输入的按键
			if (e.which == 13 || e.which >= 37 && e.which <= 40) {
				return;
			}

			// console.log(e.timeStamp);
			// 记录最后一次keyup事件时间
			lastAutoComplete = e.timeStamp;
			setTimeout(function() {
				// 如果延时设定内没有再次发生keyup事件
				if (lastAutoComplete - e.timeStamp == 0) {
					var topicTitle = $('#newQuestionTopicSearch').val();
					autoCompleteTopic(topicTitle);
				}
			}, autoCompleteDelay);

		});
		$('#newQuestionTopicSearch').on('keydown', function(e) {
			e.which == 8 && backSpaceAutoTopic();
		});
		$('#newQuestionTopicSearch').on('focus', function(e) {
			// console.log(e.timeStamp - lastAutoComplete);
			if (e.timeStamp - lastAutoComplete > autoCompleteOnFocusDelay) {
				lastAutoComplete = e.timeStamp;
				var topicTitle = $('#newQuestionTopicSearch').val();
				autoCompleteTopic(topicTitle);
			}
		});

		// 提问验证绑定 && 问题、问题补充字数控制
		//$('#newQuestioninputTitle, #newQuestioninputContent').on('keydown', function(e) {
		//	var thisValue = $(this).val(),
		//		trimValue = $.trim(thisValue),
		//		subLength = $(this).attr('data-maxlength') - 0;
		//	var exceptKeyCodeArrs = [27, 8, 9, 20, 16, 17, 18, 91, 93, 45, 46, 144, 229];
		//	// F1-F12、Page Up、Page Down、End、Home、方向键及其他功能键（去除回车、空格）、输入法
		//	if ($.trim(thisValue).length >= subLength && !(e.which >= 112 && e.which <= 123 || e.which >= 33 && e.which <= 40) && $.inArray(e.which, exceptKeyCodeArrs) == -1 && $.trim(window.getSelection()).length < 1) {
		//		e.preventDefault();
		//		$(this).val(thisValue.replace(trimValue, trimValue.substring(0, subLength)));
		//	}
		//});
		var IMELock = false;
		// compositionstart、compositionend 输入法开始、结束
		// $('#editNickname, #editPositionName, #editIntroduce').on('compositionstart', function(e) {
		// 	IMELock = true;
		// });
		// $('#editNickname, #editPositionName, #editIntroduce').on('compositionend', function(e) {
		// 	IMELock = false;
		// });
		$('#newQuestioninputTitle, #newQuestioninputContent').on('input', function(e) {
			// var thisValue = $(this).val(),
			// 	trimValue = $.trim(thisValue),
			// 	subLength = $(this).attr('data-maxlength') - 0;
			// if (trimValue.length > subLength && !IMELock) {
			// 	$(this).val(thisValue.replace(trimValue, trimValue.substring(0, subLength)));
			// }
			submitCheck();
		});
		$('#newQuestioninputTitle, #newQuestioninputContent').on('change', function(e) {
			$(this).val($.trim($(this).val()));
			submitCheck();
		});
		$('#newQuestionPopupBox').on('click', '.target_list input[type=checkbox]', function(e) {
			submitCheck();
		});
		// 发布问题按钮绑定
		$('#newQuestionPopupBox').on('click', '.new_question_submit', submitQuestion);
		questionPopup();

		// 初始化Placeholder
		var $placeholders = $('#newQuestionPopupBox .input_box input + .input_placeholder, #newQuestionPopupBox .input_box textarea + .input_placeholder');
		$placeholders.length > 0 && $placeholders.each(function(index, el) {
			$(el).siblings('input, textarea').prop('placeholder') && $(el).show().siblings('input, textarea').prop('placeholder', '');
		});
		$placeholders.on('click', function(e) {
			e.preventDefault();
			$(this).siblings('input, textarea').focus();
		});
		$placeholders.siblings('input, textarea').on('keyup', function(e) {
			// 不改变输入的按键
			if (e.which == 13 || e.which >= 37 && e.which <= 40) {
				return;
			}
			updatePlaceholder();
		});

		// 设置默认值
		defaultSettings.defaultTopicId = config.defaultTopicId;
		defaultSettings.defaultTopicName = config.defaultTopicName;
		defaultSettings.defaultIsCompanyTopic = config.defaultIsCompanyTopic;
		addTopicSelected(defaultSettings.defaultTopicId, defaultSettings.defaultTopicName, defaultSettings.defaultIsCompanyTopic);
		autoFillLocalStorage();
		updatePlaceholder();
		submitCheck();

	}

	// 替代默认Placeholder
	function updatePlaceholder() {
		var $placeholders = $('#newQuestionPopupBox .input_box input + .input_placeholder, #newQuestionPopupBox .input_box textarea + .input_placeholder');
		$placeholders.length > 0 && $placeholders.length > 0 && $placeholders.each(function(index, el) {
			$(el).siblings('input, textarea').val() ? $(el).hide() : $(el).show();
		});

	}

	// 本地保存自动填充
	function autoFillLocalStorage() {
		var fillOk = false;
		try {
			window.localStorage ? (function() {
				localStorage.autoSaveQuestionTitle && $('#newQuestioninputTitle').val(localStorage.autoSaveQuestionTitle);
				localStorage.autoSaveQuestionContent && $('#newQuestioninputContent').val(localStorage.autoSaveQuestionContent);
				fillOk = true;
			})() : (function() {
				fillOk = false;
			})();
		} catch (err) {
			console.log('auto fill local storage fail');
			fillOk = false;
		}
		return fillOk;
	}

	// 本地保存清除
	function clearLocalStorage() {
		var claerOk = false;
		try {
			window.localStorage ? (function() {
				localStorage.removeItem('autoSaveQuestionTitle');
				localStorage.removeItem('autoSaveQuestionContent');
				claerOk = true;
			})() : (function() {
				claerOk = false;
			})();
		} catch (err) {
			console.log('claer local storage fail');
			claerOk = false;
		}
		return claerOk;
	}

	// 问题搜索 AutoComplete
	var isAutoCompletingQuestion = false;

	function autoCompleteQuestion(questionTitle) {
		if (!$.trim(questionTitle)) {
			hideAutoCompleteQuestion();
			return;
		}

		if (isAutoCompletingQuestion) {
			return;
		}

		isAutoCompletingQuestion = true;
		helper.ajax({
			url: config.url.searchQuestion,
			data: {
				title: questionTitle,
				pageNum: 1,
				pageSize: 4
			}
		}).done(function(data) {
			if (data.state == 1 && data.content.data) {
				if (data.content.data.resultPage.result.length > 0) {
					var tpl = "{{each questionAutoCompleteList as item index}}\n\t{{if index < pageSize}}\n    <li data-lg-tj-id=\"1V10\" data-lg-tj-no=\"idnull\" data-lg-tj-cid=\"{{item.id}}\"><a href=\"{{FE_zbase}}/question/{{item.id}}.html\" target=\"_blank\"\"><strong class=\"question_name\">{{item.titile}}</strong><span class=\"answer_num\">已有<em>{{item.answerCount}}</em>个回答</span></a></li>\n    {{/if}}\n{{/each}}\n\t\n";
					var htmlStr = template.compile(tpl)({
						questionAutoCompleteList: data.content.data.resultPage.result,
						pageNum: 1,
						pageSize: 4,
						FE_zbase: GLOBAL_DOMAIN.zctx,
						FE_lgsbase: GLOBAL_DOMAIN.lgsctx,
						cdndomain: window.GLOBAL_CDN_DOMAIN
					});
					$('#newQuestionPopupBox .question_autoComplete_list ul').empty().append(htmlStr);
					$('#newQuestionPopupBox .question_autoComplete_box').show();
					$('#newQuestionPopupBox .question_autoComplete_list li').removeClass('active');
					$('#newQuestionPopupBox .question_autoComplete_list').scrollTop(0);
					// 使弹窗可溢出colorbox
					$('#cboxLoadedContent, #cboxContent, #cboxWrapper, #colorbox').css('overflow', 'visible');
				} else {
					$('#newQuestionPopupBox .question_autoComplete_box').hide();
				}
			} else {
				console.log(data.message);
			}
		}).fail(function() {
			console.log('searchQuestion error');
		}).always(function() {
			isAutoCompletingQuestion = false;
		});

	}

	// 隐藏 问题AutoComplete
	function hideAutoCompleteQuestion() {
		$('#newQuestionPopupBox .question_autoComplete_box').hide();

	}
	// 重置 问题AutoComplete
	function resetAutoCompleteQuestion() {
		$('#newQuestionPopupBox .question_autoComplete_box ul').empty();

	}

	// 回车跳转问题页
	function enterAutoQuestion() {
		var $questionAutoCompleteList = $('#newQuestionPopupBox .question_autoComplete_list:visible');
		if ($questionAutoCompleteList.size() < 1 || $questionAutoCompleteList.find('li.active').size() < 1) {
			return;
		}
		var $curAutoQuestion = $questionAutoCompleteList.find('li.active').first();
		window.open($curAutoQuestion.find('a').prop('href'));
		hideAutoCompleteQuestion();

	}
	// 上按钮选择问题
	function prevAutoQuestion() {
		var $questionAutoCompleteList = $('#newQuestionPopupBox .question_autoComplete_list:visible');
		if ($questionAutoCompleteList.size() < 1) {
			return;
		}
		$questionAutoCompleteList.find('li.active').size() > 0 && $questionAutoCompleteList.find('li.active').removeClass('active').prev().addClass('active');
		$questionAutoCompleteList.find('li.active').size() < 1 && $questionAutoCompleteList.find('li').last().addClass('active');

	}
	// 下按钮选择问题
	function nextAutoQuestion() {
		var $questionAutoCompleteList = $('#newQuestionPopupBox .question_autoComplete_list:visible');
		if ($questionAutoCompleteList.size() < 1) {
			return;
		}
		$questionAutoCompleteList.find('li.active').size() > 0 && $questionAutoCompleteList.find('li.active').removeClass('active').next().addClass('active');
		$questionAutoCompleteList.find('li.active').size() < 1 && $questionAutoCompleteList.find('li').first().addClass('active');

	}

	// 添加已选话题标签
	var canSelected = true;
	// 话题id，话题名，isCompanyTopic是否公司个话题，handler添加成功回调
	function addTopicSelected(id, name, isCompanyTopic, handler) {
		if (typeof id === 'number') {
			var id = id + '';
		}
		if (typeof name === 'number') {
			var name = name + '';
		}

		// 后台可能会存有没有id的话题，但是话题名是唯一的（在搜索话题时候可能会出现，P.S.话题：公司--1对多）
		if (!id && name) {
			createTopic(name, true, handler);
			return;
		}

		if (!canSelected || !id || !name) {
			return;
		}

		if ($('#newQuestionPopupBox .topic_selected_list input[value=' + id + ']').size() > 0) {
			$('#newQuestionTopicSearch').val('');
			handler && handler();
			return;
		}

		var tpl = "<li><input type=\"checkbox\" name=\"belongTopicIds\" value=\"{{id}}\" {{if isCompanyTopic}} data-is-company-topic=\"1\" {{/if}} checked=\"checked\" /><em>{{name}}</em><i>删除话题</i></li>\n";
		var htmlStr = template.compile(tpl)({
			id: id,
			name: name,
			isCompanyTopic: isCompanyTopic,
			FE_zbase: GLOBAL_DOMAIN.zctx,
			FE_lgsbase: GLOBAL_DOMAIN.lgsctx,
			cdndomain: window.GLOBAL_CDN_DOMAIN
		});
		$('#newQuestionPopupBox .topic_selected_list').append(htmlStr);
		updateTopicSelected();
		$('#newQuestionTopicSearch').val('');
		handler && handler();

	}

	// 删除已选话题标签
	function deleteTopicSelected(id, handler) {
		$('#newQuestionPopupBox .topic_selected_list').find('input[value=' + id + ']').parent('li').remove();
		updateTopicSelected();
		handler && handler();

	}

	// 刷新已选话题数量、是否显示向谁提问
	var hasAskTo = false;

	function updateTopicSelected() {
		var selectedTopicsNum = $('#newQuestionPopupBox .topic_selected_list input[name=belongTopicIds]').size();
		$('#newQuestionPopupBox .label_belongTopicIds em.topic_selected_num').html(selectedTopicsNum);
		if (selectedTopicsNum >= defaultSettings.maxTopicsNum) {
			canSelected = false;
			$('#newQuestionTopicSearch').get(0).disabled = true;
			if ($('#newQuestionTopicSearch').siblings('.input_placeholder').size() > 0) {
				$('#newQuestionTopicSearch').siblings('.input_placeholder').hide();
			} else {
				$('#newQuestionTopicSearch').get(0).placeholder = '';
			}
		} else {
			canSelected = true;
			$('#newQuestionTopicSearch').get(0).disabled = false;
			if ($('#newQuestionTopicSearch').siblings('.input_placeholder').size() > 0) {
				$('#newQuestionTopicSearch').siblings('.input_placeholder').show();
			} else {
				$('#newQuestionTopicSearch').get(0).placeholder = '搜索已有话题';
			}
		}

		if ($('#newQuestionPopupBox .topic_selected_list input[name=belongTopicIds][data-is-company-topic]').size() > 0) {
			$('#newQuestionPopupBox .label_askToIds, #newQuestionPopupBox .new_question_askToIds').show();
			hasAskTo = true;
			$.colorbox.resize();
		} else {
			$('#newQuestionPopupBox .label_askToIds, #newQuestionPopupBox .new_question_askToIds').hide();
			hasAskTo = false;
			$.colorbox.resize();
		}
		submitCheck();

	}

	// 创建话题
	var isCreatingTopic = false;
	// topicTitle话题名，isAutoCompleteTopicTitle是否是搜索填充话题，handler添加成功回调
	function createTopic(topicTitle, isAutoCompleteTopicTitle, handler) {
		if (!$.trim(topicTitle)) {
			helper.alertTips('话题名称不能为空', questionPopup);
			return;
		}

		if (isCreatingTopic) {
			return;
		}

		isCreatingTopic = true;
		// 新创建话题和已存在话题都会返回话题的id
		helper.ajax({
			url: config.url.saveTopic,
			type: 'POST',
			data: {
				title: topicTitle
			}
		}).done(function(data) {
			if (data.state == 1 && data.content.data) {
				var topicId = data.content.data.topicId,
					topicTitle = data.content.data.title || topicTitle,
					isCompanyTopic = data.content.data.hasCompany ? '1' : undefined;
				addTopicSelected(topicId, topicTitle, isCompanyTopic, handler);
			} else if (data.state == 10000) {
				helper.alertTips('在社区内测期间，你还未获得发布内容的权限<br />但这不代表拉勾不爱你，<a href="http://form.mikecrm.com/a1GjwD" target="_blank">获得资格</a>');
			} else {
				helper.alertTips(data.message, questionPopup);
				console.log(data.message);
			}
		}).fail(function() {
			isAutoCompleteTopicTitle ? helper.alertTips('选择话题失败', questionPopup) : helper.alertTips('创建话题失败', questionPopup);
			console.log('saveTopic error');
		}).always(function() {
			isCreatingTopic = false;
		});

	}

	// 话题搜索提示 AutoComplete
	var isAutoCompletingtopic = false;

	function autoCompleteTopic(topicTitle) {
		if (!$.trim(topicTitle)) {
			hideAutoCompleteTopic();
			return;
		}

		if (isAutoCompletingtopic) {
			return;
		}

		isAutoCompletingtopic = true;
		helper.ajax({
			url: config.url.searchTopic,
			data: {
				title: topicTitle,
				pageNum: 1,
				pageSize: 100
			}
		}).done(function(data) {
			if (data.state == 1 && data.content.data) {

				var tpl = "{{each topicAutoCompleteList as item index}}\n    <li data-topic-id=\"{{item.id}}\" data-topic-name=\"{{item.title}}\" {{if item.hasCompany}} data-is-company-topic=\"1\" {{/if}} data-lg-tj-id=\"1go0\" data-lg-tj-no=\"idnull\" data-lg-tj-cid=\"{{item.id}}\">{{item.title}}</li>\n{{/each}}\n\t\n";
				var htmlStr = template.compile(tpl)({
					topicAutoCompleteList: data.content.data.topicPage.result,
					FE_zbase: GLOBAL_DOMAIN.zctx,
					FE_lgsbase: GLOBAL_DOMAIN.lgsctx,
					cdndomain: window.GLOBAL_CDN_DOMAIN
				});
				$('#newQuestionPopupBox .topic_autoComplete_list ul').empty().append(htmlStr);
				$('#newQuestionPopupBox .topic_autoComplete_box').show();
				$('#newQuestionPopupBox .topic_autoComplete_list li').removeClass('active').first().addClass('active');
				$('#newQuestionPopupBox .topic_autoComplete_list').scrollTop(0);
				// 使弹窗可溢出colorbox
				$('#cboxLoadedContent, #cboxContent, #cboxWrapper, #colorbox').css('overflow', 'visible');
			} else {
				console.log(data.message);
			}
		}).fail(function() {
			console.log('searchTopic error');
		}).always(function() {
			isAutoCompletingtopic = false;
		});

	}

	// 隐藏 话题AutoComplete
	function hideAutoCompleteTopic() {
		$('#newQuestionPopupBox .topic_autoComplete_box').hide();

	}
	// 重置 话题AutoComplete
	function resetAutoCompleteTopic() {
		$('#newQuestionPopupBox .topic_autoComplete_list ul').empty();

	}

	// 回删删除已选话题标签
	function backSpaceAutoTopic() {
		var $topicSelectedList = $('#newQuestionPopupBox .topic_selected_list');
		if ($.trim($('#newQuestionTopicSearch').val()) || $topicSelectedList.find('input[name=belongTopicIds]').size() < 1) {
			return;
		}
		deleteTopicSelected($topicSelectedList.find('input[name=belongTopicIds]').last().val());

	}
	// 回车添加已选话题标签
	function enterAutoTopic() {
		var $topicAutoCompleteList = $('#newQuestionPopupBox .topic_autoComplete_list:visible');
		if ($topicAutoCompleteList.size() < 1 || $topicAutoCompleteList.find('li.active').size() < 1) {
			return;
		}
		var $curAutoTopic = $topicAutoCompleteList.find('li.active').first();
		addTopicSelected($curAutoTopic.attr('data-topic-id'), $curAutoTopic.attr('data-topic-name'), $curAutoTopic.attr('data-is-company-topic'));
		hideAutoCompleteTopic();

	}
	// 上按钮选择话题
	function prevAutoTopic() {
		var $topicAutoCompleteList = $('#newQuestionPopupBox .topic_autoComplete_list:visible');
		if ($topicAutoCompleteList.size() < 1) {
			return;
		}
		$topicAutoCompleteList.find('li.active').size() > 0 && $topicAutoCompleteList.find('li.active').removeClass('active').prev().addClass('active');
		$topicAutoCompleteList.find('li.active').size() < 1 && $topicAutoCompleteList.find('li').last().addClass('active');

		var $curAutoTopic = $topicAutoCompleteList.find('li.active');
		var prevHeight = 0,
			curHeight = $curAutoTopic.height(),
			wrapHeight = $topicAutoCompleteList.height(),
			curPositinTop = $topicAutoCompleteList.find('li.active').position().top - 10;

		$curAutoTopic.prevAll().each(function(index, el) {
			prevHeight += $(el).height();
		});

		if (curPositinTop < 0) {
			$topicAutoCompleteList.stop(true).animate({
				scrollTop: prevHeight
			}, 300);
		} else if (curPositinTop > wrapHeight - curHeight) {
			$topicAutoCompleteList.stop(true).animate({
				scrollTop: prevHeight
			}, 300);
		}

	}
	// 下按钮选择话题
	function nextAutoTopic() {
		var $topicAutoCompleteList = $('#newQuestionPopupBox .topic_autoComplete_list:visible');
		if ($topicAutoCompleteList.size() < 1) {
			return;
		}
		$topicAutoCompleteList.find('li.active').size() > 0 && $topicAutoCompleteList.find('li.active').removeClass('active').next().addClass('active');
		$topicAutoCompleteList.find('li.active').size() < 1 && $topicAutoCompleteList.find('li').first().addClass('active');

		var $curAutoTopic = $topicAutoCompleteList.find('li.active');
		var prevHeight = 0,
			curHeight = $curAutoTopic.height(),
			wrapHeight = $topicAutoCompleteList.height(),
			curPositinTop = $topicAutoCompleteList.find('li.active').position().top - 10;

		$curAutoTopic.prevAll().each(function(index, el) {
			prevHeight += $(el).height();
		});

		if (curPositinTop > wrapHeight - curHeight) {
			$topicAutoCompleteList.stop(true).animate({
				scrollTop: prevHeight - wrapHeight + curHeight
			}, 300);
		} else if (curPositinTop < 0) {
			$topicAutoCompleteList.stop(true).animate({
				scrollTop: prevHeight - wrapHeight + curHeight
			}, 300);
		}

		/*if (prevHeight >= wrapHeight && (curPositinTop > wrapHeight - curHeight || curPositinTop <= 0)) {
			$topicAutoCompleteList.stop(true).animate({
				scrollTop: prevHeight - wrapHeight + curHeight
			}, 300);
		} else if (curPositinTop <= 0) {
			$topicAutoCompleteList.stop(true).animate({
				scrollTop: 0
			}, 300);
		}*/

	}

	// 提交验证
	function submitCheck() {
		// 问题验证
		if (!$.trim($('#newQuestioninputTitle').val())) {
			// helper.alertTips('问题不能为空', questionPopup);
			$('#newQuestionPopupBox .new_question_submit').addClass('btn_disable');
			return false;
		}
		if ($.trim($('#newQuestioninputTitle').val()) && $.trim($('#newQuestioninputTitle').val()).length > 50 && !IMELock) {
			// helper.alertTips('问题最大长度不能超过50个字符', questionPopup);
			$('#newQuestionPopupBox .new_question_submit').addClass('btn_disable');
			return false;
		}
		// 问题补充验证
		if ($.trim($('#newQuestioninputContent').val()) && $.trim($('#newQuestioninputContent').val()).length > 500 && !IMELock) {
			// helper.alertTips('问题补充最大长度不能超过500个字符', questionPopup);
			$('#newQuestionPopupBox .new_question_submit').addClass('btn_disable');
			return false;
		}
		// 所属话题验证
		if ($('#newQuestionPopupBox .topic_selected_list input[name=belongTopicIds]:checked').size() < 1) {
			// helper.alertTips('至少需要选择一个所属话题', questionPopup);
			$('#newQuestionPopupBox .new_question_submit').addClass('btn_disable');
			return false;
		}
		// 向谁提问验证
		/*if (hasAskTo && $('#newQuestionPopupBox .target_list input[name=askToIds]:checked').size() < 1) {
			// helper.alertTips('至少需要选择一个向谁提问', questionPopup);
			$('#newQuestionPopupBox .new_question_submit').addClass('btn_disable');
			return false;
		}*/

		$('#newQuestionPopupBox .new_question_submit').removeClass('btn_disable');
		return true;

	}

	// 提交问题
	var isSubmitingQuestion = false;

	function submitQuestion() {
		var title = $.trim($('#newQuestioninputTitle').val()),
			belongTopicIds = [];

		$('#newQuestionPopupBox .topic_selected_list input[name=belongTopicIds]:checked').each(function() {
			belongTopicIds.push($(this).val());
		});

		if (!submitCheck() || isSubmitingQuestion) {
			return;
		}
		var content = $.trim($('#newQuestioninputContent').val()),
			askToIds = [],
			anonymous = $('#newQuestionEnableAnonymous').get(0).checked,
			source = $('#newQuestionSource').val();

		$('#newQuestionPopupBox .target_list input[name=askToIds]:checked').each(function() {
			askToIds.push($(this).val());
		});

		isSubmitingQuestion = true;
		helper.ajax({
			url: config.url.addQuestion,
			type: 'POST',
			data: {
				title: title,
				belongTopicIds: belongTopicIds,
				content: content,
				askToIds: askToIds,
				anonymous: anonymous,
				source: source
			}
		}).done(function(data) {
			if (data.state == 1) {
				clearLocalStorage();
				window.location.href = GLOBAL_DOMAIN.zctx + '/question/' + data.content.data.questionId + '.html';
			} else if (data.state == 10000) {
				helper.alertTips('在社区内测期间，你还未获得发布内容的权限<br />但这不代表拉勾不爱你，<a href="http://form.mikecrm.com/a1GjwD" target="_blank">获得资格</a>');
			} else {
				helper.alertTips(data.message, questionPopup);
				console.log(data.message);
			}

		}).fail(function() {
			helper.alertTips('发布问题失败', questionPopup);
			console.log('addQuestion error');
		}).always(function() {
			isSubmitingQuestion = false;
		});

	}

});

/*!community/modules/topic-detail/topic-card/main.js*/
;/**
 * 问答社区-话题页-话题卡片
 * 
 * @author fridayhu@lagou.com
 * 
 */
define('community/modules/topic-detail/topic-card/main', ['require', 'exports', 'module', 'community/modules/common/main', 'dep/jQuery.dotdotdot/src/jquery.dotdotdot', 'community/modules/common/new-question-btn/main'], function(require, exports, module) {
	var config = require('community/modules/common/main').config,
		helper = require('community/modules/common/main').helper;
	require('dep/jQuery.dotdotdot/src/jquery.dotdotdot');

	// 话题卡片展示
	$('#topicCard .topic_content').dotdotdot();
	// 提个问题按钮
	require('community/modules/common/new-question-btn/main');

	// 关注
	var followLoadingHtml = '<div class="loading2">Loading...</div>';
	$('#topicCard').on('click', '.follow_btn', function(e) {
		var $this = $(this);
		if ($this.data('isLoading')) {
			return;
		}
		var topicId = $this.attr('data-topic-id');
		var originHtml = $this.html();
		$this.html(followLoadingHtml);
		$this.data('isLoading', true);
		if ($this.hasClass('btn_cancel')) {
			// 取消关注
			helper.cancelFollwTopic(topicId, {
				done: function(data) {
					$this.removeClass('btn_cancel');
					$this.html('关注');
					$this.parent().parent('.topic_card_box').find('.topic_card_bar .topic_status .follow_num').html(data.content.data.count);
				},
				fail: function() {
					$this.html(originHtml);
				},
				always: function() {
					$this.removeData('isLoading');
				}
			});
		} else {
			// 关注
			helper.followTopic(topicId, {
				done: function(data) {
					$this.addClass('btn_cancel');
					$this.html('已关注');
					$this.parent().parent('.topic_card_box').find('.topic_card_bar .topic_status .follow_num').html(data.content.data.count);
				},
				fail: function() {
					$this.html(originHtml);
				},
				always: function() {
					$this.removeData('isLoading');
				}
			});
		}
	});
	$('#topicCard').on('mouseenter', '.follow_btn.btn_cancel', function(e) {
		$(this).html('取消');
	});
	$('#topicCard').on('mouseleave', '.follow_btn.btn_cancel', function(e) {
		$(this).html('已关注');
	});

});

/*!community/modules/common/user-card-float/main.js*/
;/**
 * 问答社区-浮动用户卡片
 * 
 * @author fridayhu@lagou.com
 *
 * @require "community/modules/common/user-card-float/main.less"
 * 
 */
define('community/modules/common/user-card-float/main', ['require', 'exports', 'module', 'community/modules/common/main', 'dep/artTemplate/dist/template'], function(require, exports, module) {

	var config = require('community/modules/common/main').config,
		helper = require('community/modules/common/main').helper;
	var template = require('dep/artTemplate/dist/template');

	/**
	 * artTemplate3.01中存在bug，{{userinfoFloat | userCardFloat:curUserid}}传入的参数会转为字符串，更新3.03前不要使用此辅助方法
	 * 可在js中用template.compile直接传入参数渲染模板
	 * 或者利用fis3内容嵌入能力嵌入到父模板中使用
	 */
	/*template.helper('userCardFloat', function(userinfoFloat, curUserid) {
		if (!userinfoFloat) {
			return;
		}
		var tpl = __inline('./tpl/main.tpl');
		var htmlStr = template.compile(tpl)({
			userinfoFloat: userinfoFloat,
			curUserid: curUserid,
			FE_base: GLOBAL_DOMAIN.ctx,
			FE_zbase: GLOBAL_DOMAIN.zctx,
			FE_lgsbase: GLOBAL_DOMAIN.lgsctx,
			cdndomain: window.GLOBAL_CDN_DOMAIN
		});
		return htmlStr;
	});*/

	// 关注
	var followLoadingHtml = '<div class="loading2">Loading...</div>';
	$('body').on('click', '.user_card_float .user_follow_btn', function(e) {
		var $this = $(this);
		if ($this.data('isLoading')) {
			return;
		}
		var userId = $this.attr('data-user-id');
		var originHtml = $this.html();
		$this.html(followLoadingHtml);
		$this.data('isLoading', true);
		if ($this.hasClass('btn_cancel')) {
			// 取消关注
			helper.cancelFollowUser(userId, {
				done: function(data) {
					$this.removeClass('btn_cancel').html('<i>加</i>关注');
					$('.user_card_float .user_follow_btn[data-user-id=' + userId + ']').removeClass('btn_cancel').html('<i>加</i>关注');
				},
				fail: function() {
					$this.html(originHtml);
				},
				always: function() {
					$this.removeData('isLoading');
				}
			});
		} else {
			// 关注
			helper.followUser(userId, {
				done: function(data) {
					$this.addClass('btn_cancel').html('已关注');
					$('.user_card_float .user_follow_btn[data-user-id=' + userId + ']').addClass('btn_cancel').html('已关注');
				},
				fail: function() {
					$this.html(originHtml);
				},
				always: function() {
					$this.removeData('isLoading');
				}
			});
		}
	});
	$('body').on('mouseenter', '.user_card_float .user_follow_btn.btn_cancel', function(e) {
		$(this).html('取消');
	});
	$('body').on('mouseleave', '.user_card_float .user_follow_btn.btn_cancel', function(e) {
		$(this).html('已关注');
	});

});

/*!dep/jquery-qrcode/jquery.qrcode.min.js*/
;define('dep/jquery-qrcode/jquery.qrcode.min', ['require', 'exports', 'module'], function(require, exports, module) {

  (function(r){r.fn.qrcode=function(h){var s;function u(a){this.mode=s;this.data=a}function o(a,c){this.typeNumber=a;this.errorCorrectLevel=c;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]}function q(a,c){if(void 0==a.length)throw Error(a.length+"/"+c);for(var d=0;d<a.length&&0==a[d];)d++;this.num=Array(a.length-d+c);for(var b=0;b<a.length-d;b++)this.num[b]=a[b+d]}function p(a,c){this.totalCount=a;this.dataCount=c}function t(){this.buffer=[];this.length=0}u.prototype={getLength:function(){return this.data.length},
  write:function(a){for(var c=0;c<this.data.length;c++)a.put(this.data.charCodeAt(c),8)}};o.prototype={addData:function(a){this.dataList.push(new u(a));this.dataCache=null},isDark:function(a,c){if(0>a||this.moduleCount<=a||0>c||this.moduleCount<=c)throw Error(a+","+c);return this.modules[a][c]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var a=1,a=1;40>a;a++){for(var c=p.getRSBlocks(a,this.errorCorrectLevel),d=new t,b=0,e=0;e<c.length;e++)b+=c[e].dataCount;
  for(e=0;e<this.dataList.length;e++)c=this.dataList[e],d.put(c.mode,4),d.put(c.getLength(),j.getLengthInBits(c.mode,a)),c.write(d);if(d.getLengthInBits()<=8*b)break}this.typeNumber=a}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17;this.modules=Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[d][b]=null}this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-
  7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(a,c);7<=this.typeNumber&&this.setupTypeNumber(a);null==this.dataCache&&(this.dataCache=o.createData(this.typeNumber,this.errorCorrectLevel,this.dataList));this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,c){for(var d=-1;7>=d;d++)if(!(-1>=a+d||this.moduleCount<=a+d))for(var b=-1;7>=b;b++)-1>=c+b||this.moduleCount<=c+b||(this.modules[a+d][c+b]=
  0<=d&&6>=d&&(0==b||6==b)||0<=b&&6>=b&&(0==d||6==d)||2<=d&&4>=d&&2<=b&&4>=b?!0:!1)},getBestMaskPattern:function(){for(var a=0,c=0,d=0;8>d;d++){this.makeImpl(!0,d);var b=j.getLostPoint(this);if(0==d||a>b)a=b,c=d}return c},createMovieClip:function(a,c,d){a=a.createEmptyMovieClip(c,d);this.make();for(c=0;c<this.modules.length;c++)for(var d=1*c,b=0;b<this.modules[c].length;b++){var e=1*b;this.modules[c][b]&&(a.beginFill(0,100),a.moveTo(e,d),a.lineTo(e+1,d),a.lineTo(e+1,d+1),a.lineTo(e,d+1),a.endFill())}return a},
  setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=0==a%2);for(a=8;a<this.moduleCount-8;a++)null==this.modules[6][a]&&(this.modules[6][a]=0==a%2)},setupPositionAdjustPattern:function(){for(var a=j.getPatternPosition(this.typeNumber),c=0;c<a.length;c++)for(var d=0;d<a.length;d++){var b=a[c],e=a[d];if(null==this.modules[b][e])for(var f=-2;2>=f;f++)for(var i=-2;2>=i;i++)this.modules[b+f][e+i]=-2==f||2==f||-2==i||2==i||0==f&&0==i?!0:!1}},setupTypeNumber:function(a){for(var c=
  j.getBCHTypeNumber(this.typeNumber),d=0;18>d;d++){var b=!a&&1==(c>>d&1);this.modules[Math.floor(d/3)][d%3+this.moduleCount-8-3]=b}for(d=0;18>d;d++)b=!a&&1==(c>>d&1),this.modules[d%3+this.moduleCount-8-3][Math.floor(d/3)]=b},setupTypeInfo:function(a,c){for(var d=j.getBCHTypeInfo(this.errorCorrectLevel<<3|c),b=0;15>b;b++){var e=!a&&1==(d>>b&1);6>b?this.modules[b][8]=e:8>b?this.modules[b+1][8]=e:this.modules[this.moduleCount-15+b][8]=e}for(b=0;15>b;b++)e=!a&&1==(d>>b&1),8>b?this.modules[8][this.moduleCount-
  b-1]=e:9>b?this.modules[8][15-b-1+1]=e:this.modules[8][15-b-1]=e;this.modules[this.moduleCount-8][8]=!a},mapData:function(a,c){for(var d=-1,b=this.moduleCount-1,e=7,f=0,i=this.moduleCount-1;0<i;i-=2)for(6==i&&i--;;){for(var g=0;2>g;g++)if(null==this.modules[b][i-g]){var n=!1;f<a.length&&(n=1==(a[f]>>>e&1));j.getMask(c,b,i-g)&&(n=!n);this.modules[b][i-g]=n;e--; -1==e&&(f++,e=7)}b+=d;if(0>b||this.moduleCount<=b){b-=d;d=-d;break}}}};o.PAD0=236;o.PAD1=17;o.createData=function(a,c,d){for(var c=p.getRSBlocks(a,
  c),b=new t,e=0;e<d.length;e++){var f=d[e];b.put(f.mode,4);b.put(f.getLength(),j.getLengthInBits(f.mode,a));f.write(b)}for(e=a=0;e<c.length;e++)a+=c[e].dataCount;if(b.getLengthInBits()>8*a)throw Error("code length overflow. ("+b.getLengthInBits()+">"+8*a+")");for(b.getLengthInBits()+4<=8*a&&b.put(0,4);0!=b.getLengthInBits()%8;)b.putBit(!1);for(;!(b.getLengthInBits()>=8*a);){b.put(o.PAD0,8);if(b.getLengthInBits()>=8*a)break;b.put(o.PAD1,8)}return o.createBytes(b,c)};o.createBytes=function(a,c){for(var d=
  0,b=0,e=0,f=Array(c.length),i=Array(c.length),g=0;g<c.length;g++){var n=c[g].dataCount,h=c[g].totalCount-n,b=Math.max(b,n),e=Math.max(e,h);f[g]=Array(n);for(var k=0;k<f[g].length;k++)f[g][k]=255&a.buffer[k+d];d+=n;k=j.getErrorCorrectPolynomial(h);n=(new q(f[g],k.getLength()-1)).mod(k);i[g]=Array(k.getLength()-1);for(k=0;k<i[g].length;k++)h=k+n.getLength()-i[g].length,i[g][k]=0<=h?n.get(h):0}for(k=g=0;k<c.length;k++)g+=c[k].totalCount;d=Array(g);for(k=n=0;k<b;k++)for(g=0;g<c.length;g++)k<f[g].length&&
  (d[n++]=f[g][k]);for(k=0;k<e;k++)for(g=0;g<c.length;g++)k<i[g].length&&(d[n++]=i[g][k]);return d};s=4;for(var j={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,
  78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var c=a<<10;0<=j.getBCHDigit(c)-j.getBCHDigit(j.G15);)c^=j.G15<<j.getBCHDigit(c)-j.getBCHDigit(j.G15);return(a<<10|c)^j.G15_MASK},getBCHTypeNumber:function(a){for(var c=a<<12;0<=j.getBCHDigit(c)-
  j.getBCHDigit(j.G18);)c^=j.G18<<j.getBCHDigit(c)-j.getBCHDigit(j.G18);return a<<12|c},getBCHDigit:function(a){for(var c=0;0!=a;)c++,a>>>=1;return c},getPatternPosition:function(a){return j.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,c,d){switch(a){case 0:return 0==(c+d)%2;case 1:return 0==c%2;case 2:return 0==d%3;case 3:return 0==(c+d)%3;case 4:return 0==(Math.floor(c/2)+Math.floor(d/3))%2;case 5:return 0==c*d%2+c*d%3;case 6:return 0==(c*d%2+c*d%3)%2;case 7:return 0==(c*d%3+(c+d)%2)%2;default:throw Error("bad maskPattern:"+
  a);}},getErrorCorrectPolynomial:function(a){for(var c=new q([1],0),d=0;d<a;d++)c=c.multiply(new q([1,l.gexp(d)],0));return c},getLengthInBits:function(a,c){if(1<=c&&10>c)switch(a){case 1:return 10;case 2:return 9;case s:return 8;case 8:return 8;default:throw Error("mode:"+a);}else if(27>c)switch(a){case 1:return 12;case 2:return 11;case s:return 16;case 8:return 10;default:throw Error("mode:"+a);}else if(41>c)switch(a){case 1:return 14;case 2:return 13;case s:return 16;case 8:return 12;default:throw Error("mode:"+
  a);}else throw Error("type:"+c);},getLostPoint:function(a){for(var c=a.getModuleCount(),d=0,b=0;b<c;b++)for(var e=0;e<c;e++){for(var f=0,i=a.isDark(b,e),g=-1;1>=g;g++)if(!(0>b+g||c<=b+g))for(var h=-1;1>=h;h++)0>e+h||c<=e+h||0==g&&0==h||i==a.isDark(b+g,e+h)&&f++;5<f&&(d+=3+f-5)}for(b=0;b<c-1;b++)for(e=0;e<c-1;e++)if(f=0,a.isDark(b,e)&&f++,a.isDark(b+1,e)&&f++,a.isDark(b,e+1)&&f++,a.isDark(b+1,e+1)&&f++,0==f||4==f)d+=3;for(b=0;b<c;b++)for(e=0;e<c-6;e++)a.isDark(b,e)&&!a.isDark(b,e+1)&&a.isDark(b,e+
  2)&&a.isDark(b,e+3)&&a.isDark(b,e+4)&&!a.isDark(b,e+5)&&a.isDark(b,e+6)&&(d+=40);for(e=0;e<c;e++)for(b=0;b<c-6;b++)a.isDark(b,e)&&!a.isDark(b+1,e)&&a.isDark(b+2,e)&&a.isDark(b+3,e)&&a.isDark(b+4,e)&&!a.isDark(b+5,e)&&a.isDark(b+6,e)&&(d+=40);for(e=f=0;e<c;e++)for(b=0;b<c;b++)a.isDark(b,e)&&f++;a=Math.abs(100*f/c/c-50)/5;return d+10*a}},l={glog:function(a){if(1>a)throw Error("glog("+a+")");return l.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;256<=a;)a-=255;return l.EXP_TABLE[a]},EXP_TABLE:Array(256),
  LOG_TABLE:Array(256)},m=0;8>m;m++)l.EXP_TABLE[m]=1<<m;for(m=8;256>m;m++)l.EXP_TABLE[m]=l.EXP_TABLE[m-4]^l.EXP_TABLE[m-5]^l.EXP_TABLE[m-6]^l.EXP_TABLE[m-8];for(m=0;255>m;m++)l.LOG_TABLE[l.EXP_TABLE[m]]=m;q.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var c=Array(this.getLength()+a.getLength()-1),d=0;d<this.getLength();d++)for(var b=0;b<a.getLength();b++)c[d+b]^=l.gexp(l.glog(this.get(d))+l.glog(a.get(b)));return new q(c,0)},mod:function(a){if(0>
  this.getLength()-a.getLength())return this;for(var c=l.glog(this.get(0))-l.glog(a.get(0)),d=Array(this.getLength()),b=0;b<this.getLength();b++)d[b]=this.get(b);for(b=0;b<a.getLength();b++)d[b]^=l.gexp(l.glog(a.get(b))+c);return(new q(d,0)).mod(a)}};p.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],
  [4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,
  116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,
  43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,
  3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,
  55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,
  45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];p.getRSBlocks=function(a,c){var d=p.getRsBlockTable(a,c);if(void 0==d)throw Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+c);for(var b=d.length/3,e=[],f=0;f<b;f++)for(var h=d[3*f+0],g=d[3*f+1],j=d[3*f+2],l=0;l<h;l++)e.push(new p(g,j));return e};p.getRsBlockTable=function(a,c){switch(c){case 1:return p.RS_BLOCK_TABLE[4*(a-1)+0];case 0:return p.RS_BLOCK_TABLE[4*(a-1)+1];case 3:return p.RS_BLOCK_TABLE[4*
  (a-1)+2];case 2:return p.RS_BLOCK_TABLE[4*(a-1)+3]}};t.prototype={get:function(a){return 1==(this.buffer[Math.floor(a/8)]>>>7-a%8&1)},put:function(a,c){for(var d=0;d<c;d++)this.putBit(1==(a>>>c-d-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0);a&&(this.buffer[c]|=128>>>this.length%8);this.length++}};"string"===typeof h&&(h={text:h});h=r.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,
  correctLevel:2,background:"#ffffff",foreground:"#000000"},h);return this.each(function(){var a;if("canvas"==h.render){a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();var c=document.createElement("canvas");c.width=h.width;c.height=h.height;for(var d=c.getContext("2d"),b=h.width/a.getModuleCount(),e=h.height/a.getModuleCount(),f=0;f<a.getModuleCount();f++)for(var i=0;i<a.getModuleCount();i++){d.fillStyle=a.isDark(f,i)?h.foreground:h.background;var g=Math.ceil((i+1)*b)-Math.floor(i*b),
  j=Math.ceil((f+1)*b)-Math.floor(f*b);d.fillRect(Math.round(i*b),Math.round(f*e),g,j)}}else{a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();c=r("<table></table>").css("width",h.width+"px").css("height",h.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",h.background);d=h.width/a.getModuleCount();b=h.height/a.getModuleCount();for(e=0;e<a.getModuleCount();e++){f=r("<tr></tr>").css("height",b+"px").appendTo(c);for(i=0;i<a.getModuleCount();i++)r("<td></td>").css("width",
  d+"px").css("background-color",a.isDark(e,i)?h.foreground:h.background).appendTo(f)}}a=c;jQuery(a).appendTo(this)})}})(jQuery);
  

});
/*!community/modules/common/share/main.js*/
;/**
 * 问答社区-分享弹窗
 * 在要添加分享弹窗的标签上添加类名 share_popup_btn ,并且添加自定义属性data-share-url="xxx" 即可使用
 * 
 * @author fridayhu@lagou.com
 *
 * @require "community/modules/common/share/main.less"
 * 
 */

define('community/modules/common/share/main', ['require', 'exports', 'module', 'dep/jquery-qrcode/jquery.qrcode.min', 'community/modules/common/main', 'dep/artTemplate/dist/template'], function(require, exports, module) {

	require('dep/jquery-qrcode/jquery.qrcode.min');
	var config = require('community/modules/common/main').config,
		helper = require('community/modules/common/main').helper;
	var template = require('dep/artTemplate/dist/template');

	$('body').on('click', '.share_popup_btn', function(e) {
		if ($('.share_popup_box').size() < 1) {
			var htmlStr = [
				'	<div class="share_popup_box animated" id="sharePopupBox">',
				'		<div class="popup_box_wrap">',
				'			<div class="wechat_box">',
				'				<div class="qrcode_box"></div>',
				'				<p class="tips"> <i>微信</i>',
				'					扫一扫分享到微信',
				'				</p>',
				'			</div>',
				'			<span class="deck_out"></span>',
				'			<span class="deck_in"></span>',
				'		</div>',
				'	</div>'
			].join('');
			$('body').append(htmlStr);
			$('#sharePopupBox').click(function(e) {
				e.stopPropagation();
			});
		}
		$('#sharePopupBox').css({
			top: $(this).offset().top + $(this).innerHeight() + 12,
			left: $(this).offset().left - $('#sharePopupBox').innerWidth() / 2 - 3 + $(this).innerWidth() / 2
		});
		flushQrCode($(this).attr('data-share-url'));
		if ($('#sharePopupBox:visible').size() > 0) {
			$('#sharePopupBox').hide(0).show(0).removeClass('fadeOutDown').addClass('fadeInUp');
		} else {
			$('#sharePopupBox').show(0).removeClass('fadeOutDown').addClass('fadeInUp');
		}
		e.stopPropagation();
	});

	$('body').click(function() {
		$('#sharePopupBox').removeClass('fadeInUp').addClass('fadeOutDown').delay(500).hide(0);
	});

	function flushQrCode(url) {
		if (!url) {
			return;
		}

		var fullUrl = $('<a href="' + url + '"></a>').prop('href');

		var qrCodeConfig = {
			width: 120,
			height: 120,
			text: fullUrl
		}

		var DEFAULT_VERSION = "8.0";
		var ua = navigator.userAgent.toLowerCase();
		var isIE = ua.indexOf("msie") > -1;
		if (isIE) {
			var ieVersion = ua.match(/msie ([\d.]+)/)[1];
			if (ieVersion <= DEFAULT_VERSION) {
				qrCodeConfig.render = 'table'
			}
		}

		$('#sharePopupBox .qrcode_box').empty();
		$('#sharePopupBox .qrcode_box').qrcode(qrCodeConfig);
	}

});

/*!community/modules/topic-detail/news/main.js*/
;/**
 * 问答社区-话题页-最新动态
 * 
 * @author fridayhu@lagou.com
 * 
 */
define('community/modules/topic-detail/news/main', ['require', 'exports', 'module', 'community/modules/common/main', 'dep/artTemplate/dist/template', 'dep/jQuery.dotdotdot/src/jquery.dotdotdot', 'community/modules/common/user-card-float/main', 'community/modules/common/share/main'], function(require, exports, module) {

	var config = require('community/modules/common/main').config,
		helper = require('community/modules/common/main').helper;
	var template = require('dep/artTemplate/dist/template');
	require('dep/jQuery.dotdotdot/src/jquery.dotdotdot');
	require('community/modules/common/user-card-float/main');
	require('community/modules/common/share/main');

	// 首屏展示
	$('#topicNewsList .item_question').dotdotdot();
	$('#topicNewsList .answer_summary').dotdotdot({
		after: 'a.expand_answer',
		callback: function(isTruncated, orgContent) {
			if (isTruncated) {
				// $(orgContent.context).find('a.expand_answer').show();
			}
		}
	});

	// 展开收起
	$('#topicNewsList').on('click', '.answer_thumbnail_box, .answer_summary', function(e) {
		var $this = $(this),
			$contentBox = $this.parent('.item_content');
		$contentBox.find('.answer_thumbnail_box, .answer_summary').hide();
		if ($contentBox.find('.answer_full_content').size() < 1) {
			var $answerFullContent = $('<div class="answer_full_content editor_parse"></div>');
			$answerFullContent.append($contentBox.find('.answer_html').val());
			$contentBox.find('.answer_full').append($answerFullContent);
		}
		$contentBox.find('.answer_full').show();
		$contentBox.find('.item_status').prepend('<span class="status_item answer_full_time">发布于' + $contentBox.parent('.normal_question, .essence_question').find('.item_header .item_time').text() + '</span>').append('<a class="fold_answer fr" href="javascript:;">收起<i class="icon_fold"></i></a>');
	});
	$('#topicNewsList').on('click', '.fold_answer', function(e) {
		var $this = $(this),
			$contentBox = $this.parent().parent('.item_content');
		$contentBox.find('.answer_full').hide();
		$contentBox.find('.answer_thumbnail_box, .answer_summary').show();
		$contentBox.find('.item_status .answer_full_time').remove();
		$contentBox.find('.item_status .fold_answer').remove();
		var answerTop = $contentBox.parent('.normal_question, .essence_question').find('.item_header').offset().top;
		if ($('html').get(0).scrollTop > answerTop || $('body').get(0).scrollTop > answerTop) {
			$('html, body').animate({
				scrollTop: answerTop
			}, 200);
		}
	});
	/*$('#topicNewsList').on('click', '.answer_full', function(e) {
		var $this = $(this),
			$contentBox = $this.parent('.item_content');
		$this.hide();
		$contentBox.find('.answer_thumbnail_box, .answer_summary').show();
	});*/

	// 赞
	// var supportLoadingHtml = '<div class="loading2">Loading...</div>';
	$('#topicNewsList').on('click', '.normal_question .support_bar a, .essence_question .support_bar a', function(e) {
		var $this = $(this);
		if ($this.data('isLoading')) {
			return;
		}
		var answerId = $this.attr('data-answer-id');
		var originHtml = $this.find('.support_num').html();
		// $this.find('.support_num').html(supportLoadingHtml);
		$this.data('isLoading', true);
		if ($this.hasClass('has_support')) {
			// 取消赞
			helper.cancelSupportAnswer(answerId, {
				done: function(data) {
					$this.removeClass('has_support');
					$this.find('.support_num').html(data.content.data.starCount);
				},
				fail: function() {
					$this.find('.support_num').html(originHtml);
				},
				always: function() {
					$this.removeData('isLoading');
				}
			});
		} else {
			// 赞
			helper.supportAnswer(answerId, {
				done: function(data) {
					$this.addClass('has_support');
					$this.find('.support_num').html(data.content.data.starCount);
				},
				fail: function() {
					$this.find('.support_num').html(originHtml);
				},
				always: function() {
					$this.removeData('isLoading');
				}
			});
		}
	});

	// 加载更多
	var pageNum = 1,
		pageSize = 10,
		isLoadingNews = false,
		newsMoreLoadingHtml = [
			'	<div class="loading1 news_loding">',
			'		<div class="rect1">L</div>',
			'		<div class="rect2">o</div>',
			'		<div class="rect3">a</div>',
			'		<div class="rect4">d</div>',
			'		<div class="rect5">ing</div>',
			'	</div>'
		].join('');

	$('#topicNewsMore').size() && $('#topicNewsMore').click(function(e) {
		var topicId = $(e.target).attr('data-topic-id');
		getMoreNews(topicId);
	});

	function getMoreNews(topicId) {

		if (isLoadingNews) {
			return;
		}
		isLoadingNews = true;
		$('#topicNewsMore').addClass('btn_disable').hide();
		if ($('#topicNews .news_loding').size() < 1) {
			$('#topicNewsMore').after(newsMoreLoadingHtml);
		}
		$('#topicNews .news_loding').show();
		helper.ajax({
			url: config.topicDetailURL.getMoreTopicNews,
			data: {
				topicId: topicId,
				pageNo: pageNum + 1,
				pageSize: pageSize
			}
		}).done(function(data) {
			if (data.state == 1 && data.content.data) {
				pageNum += 1;
				var tpl = "{{if topicNewsList}}\n\t{{each topicNewsList as item index}}\n\t\t{{if item.type == 'QUESTION_ADD' && item.news.answerInfoList && item.news.answerInfoList.length > 1}}\n\t\t<li class=\"list_more\">\n\t\t\t<div class=\"normal_question_list item clearfix\">\n\t\t\t\t<!-- <h4 class=\"item_question question_name\" data-question-id=\"{{item.news.questionId}}\"><a href=\"{{FE_zbase}}/question/{{item.news.questionId}}.html\" target=\"_blank\">{{item.news.questionTitle}}</a></h4> -->\n\t\t\t\t<ul class=\"list\">\n\t\t\t\t\t{{each item.news.answerInfoList as answer answerIndex}}\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<div class=\"normal_question item\">\n\t\t\t\t\t\t\t<div class=\"item_header\">\n\t\t\t\t\t\t\t\t{{if answer.anonymous}}\n\t\t\t\t\t\t\t\t<div class=\"answerer_avatar\">\n\t\t\t\t\t\t\t\t\t<a class=\"anonymous\" href=\"javascript:;\"><img src=\"//www.lgstatic.com/lg-community-fed/community/modules/common/img/avatar_default_7225407.png\" width=\"44\" height=\"44\" alt=\"{{answer.userName}}\" /></a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<strong class=\"answerer_name\">\n\t\t\t\t\t\t\t\t\t<a class=\"anonymous\" href=\"javascript:;\">匿名用户</a>\n\t\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t\t\t<span class=\"answerer_position\">可能来自遥远的阿贝尔2029星系群</span>\n\t\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t<div class=\"answerer_avatar\">\n\t\t\t\t\t\t\t\t\t{{if answer.answerUser.portrait && answer.answerUser.portrait !=''}}\n\t\t\t\t\t\t\t\t\t<a href=\"{{FE_zbase}}/user/userIndex-{{answer.answerUser.id}}.html\" target=\"_blank\" data-lg-tj-id=\"1i80\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerUser.id}}\"><img src=\"{{FE_lgsbase}}/{{answer.answerUser.portrait}}\" width=\"44\" height=\"44\" alt=\"{{answer.answerUser.userName}}\" /></a>\n\t\t\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t\t<a href=\"{{FE_zbase}}/user/userIndex-{{answer.answerUser.id}}.html\" target=\"_blank\" data-lg-tj-id=\"1i80\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerUser.id}}\"><img src=\"//www.lgstatic.com/lg-community-fed/community/modules/common/img/avatar_default_7225407.png\" width=\"44\" height=\"44\" alt=\"{{answer.answerUser.userName}}\" /></a>\n\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<strong class=\"answerer_name user_card_float_wrap\">\n\t\t\t\t\t\t\t\t\t<a href=\"{{FE_zbase}}/user/userIndex-{{answer.answerUser.id}}.html\" target=\"_blank\" data-lg-tj-id=\"1i80\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerUser.id}}\">{{answer.answerUser.userName}}</a>\n\t\t\t\t\t\t\t\t\t<span style=\"display: none;\">{{userinfoFloat = answer.answerUser}}</span>\n\t\t\t\t\t\t\t\t\t<!--\n    问答社区-浮动用户卡片 arttemplate模板\n-->\n\n<div class=\"user_card_float\">\n    <div class=\"user_card_float_box\">\n        <div class=\"avatar fl\">\n            <a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html\" target=\"_blank\">\n                {{if userinfoFloat.portrait && userinfoFloat.portrait != ''}}\n                <img src=\"{{FE_lgsbase}}/{{userinfoFloat.portrait}}\" width=\"54\" height=\"54\" />\n                {{else}}\n                <img src=\"../img/avatar_default.png\" width=\"54\" height=\"54\" />\n                {{/if}}\n            </a>\n        </div>\n        <div class=\"userinfo_base\">\n            <a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html\" target=\"_blank\">\n                {{if userinfoFloat.userName.length > 15}}\n                <span>{{userinfoFloat.userName.substring(0,14)}}...</span>\n                {{else}}\n                <span>{{userinfoFloat.userName}}</span>\n                {{/if}}\n                {{if userinfoFloat.sex == 'MALE'}}\n                <i class=\"boy\">男</i>\n                {{else if userinfoFloat.sex == 'FEMALE'}}\n                <i class=\"girl\">女</i>\n                {{/if}}\n            </a>\n        </div>\n        {{if userinfoFloat.id == curUserid}}\n        <!-- <a class=\"userinfo_edit\" href=\"javascript:;\">编辑</a> -->\n        {{/if}}\n        <p class=\"userinfo_job\" title=\"{{userinfoFloat.positionName}}\"><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html\" target=\"_blank\">{{userinfoFloat.positionName}}</a></p>\n        <p class=\"userinfo_intro\" title=\"{{userinfoFloat.introduce}}\"><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html\" target=\"_blank\">{{userinfoFloat.introduce}}</a></p>\n        <div class=\"user_status\">\n            <ul class=\"clearfix\">\n                <li><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html?newsType=QUESTION\" target=\"_blank\"><em>{{userinfoFloat.questionNum}}</em>提问</a></li>\n                <li><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html?newsType=ANSWER\" target=\"_blank\"><em>{{userinfoFloat.answerNum}}</em>回答</a></li>\n                <li><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html?newsType=ANSWER\" target=\"_blank\"><em>{{userinfoFloat.gainStarNum}}</em>获赞</a></li>\n            </ul>\n        </div>\n        {{if userinfoFloat.isFollow && userinfoFloat.id != curUserid}}\n        <a class=\"user_follow_btn btn btn_cancel\" href=\"javascript:;\" data-user-id=\"{{userinfoFloat.id}}\">已关注</a>\n        {{else if userinfoFloat.id != curUserid}}\n        <a class=\"user_follow_btn btn\" href=\"javascript:;\" data-user-id=\"{{userinfoFloat.id}}\"><i>加</i>关注</a>\n        {{/if}}\n        <span class=\"deck_out\"></span>\n        <span class=\"deck_in\"></span>\n    </div>\n</div>\n\n\t\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t\t\t<span class=\"answerer_position\">{{answer.answerUser.positionName}}</span>\n\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t<span class=\"item_tittle\">回答了</span>\n\t\t\t\t\t\t\t\t<span class=\"item_time fr\">{{answer.time}}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<h4 class=\"item_question question_name\" data-question-id=\"{{item.news.questionId}}\"><a href=\"{{FE_zbase}}/question/{{item.news.questionId}}.html\" target=\"_blank\" data-lg-tj-id=\"1i90\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{item.news.questionId}}\">{{item.news.questionTitle}}</a></h4>\n\t\t\t\t\t\t\t<div class=\"item_content clearfix\">\n\t\t\t\t\t\t\t\t<div class=\"support_bar fl\">\n\t\t\t\t\t\t\t\t\t<a class=\"{{if answer.isStar}} has_support {{/if}}\" href=\"javascript:;\" data-answer-id=\"{{answer.answerId}}\" data-lg-tj-id=\"1ia0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\">\n\t\t\t\t\t\t\t\t\t\t<i class=\"support_btn icon-glyph-like\"></i>\n\t\t\t\t\t\t\t\t\t\t<strong class=\"support_num\">{{answer.starNum}}</strong>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{{if answer.thumbnail && answer.thumbnail != ''}}\n\t\t\t\t\t\t\t\t<a class=\"answer_thumbnail_box fl\" href=\"javascript:;\" data-lg-tj-id=\"1ib0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\"><img class=\"answer_thumbnail\" src=\"{{answer.thumbnail.replace(/^https?\\:\\/\\/www\\.lagou\\.com/i, FE_lgsbase)}}\" /></a>\n\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t<p class=\"answer_summary\" data-lg-tj-id=\"1ic0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\">\n\t\t\t\t\t\t\t\t\t{{answer.summary}}\n\t\t\t\t\t\t\t\t\t<a class=\"expand_answer\" href=\"javascript:;\" data-lg-tj-id=\"1id0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\">展开<i class=\"icon_expand\"></i></a>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t<textarea class=\"answer_html\">{{#answer.answerContent}}</textarea>\n\t\t\t\t\t\t\t\t<div class=\"answer_full\"></div>\n\t\t\t\t\t\t\t\t<div class=\"item_status status_bar\">\n\t\t\t\t\t\t\t\t\t<span class=\"status_item\"><a href=\"{{FE_zbase}}/answer/{{answer.answerId}}.html\" target=\"_blank\" data-lg-tj-id=\"1ie0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\"><em class=\"comment_num highlight\">{{answer.commentNum}}</em>条评论</a></span>\n\t\t\t\t\t\t\t\t\t<!-- <span class=\"status_item\">来自<em class=\"from\">{{if item.news.source == 'PC'}} lagou.com {{else if item.news.source == 'APP'}} 拉勾APP {{else}} lagou.com {{/if}}</em></span> -->\n\t\t\t\t\t\t\t\t\t<span class=\"status_item\"><a class=\"share_popup_btn\" href=\"javascript:;\" data-share-url=\"{{FE_zbase}}/share/answer_{{answer.answerId}}.html\" data-lg-tj-id=\"1F90\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\">分享</a></span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</li>\n\t\t\t\t\t{{/each}}\n\t\t\t\t</ul>\n\t\t\t\t<a class=\"more_answer fr\" href=\"{{FE_zbase}}/question/{{item.news.questionId}}.html\" target=\"_blank\" data-lg-tj-id=\"1if0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{item.news.questionId}}\">查看全部<span class=\"answer_num\">{{item.news.answerNum}}</span>个回答</a>\n\t\t\t</div>\n\t\t</li>\n\t\t{{else if item.type == 'QUESTION_ADD' && item.news.answerInfoList && item.news.answerInfoList.length > 0}}\n\t\t\t{{each item.news.answerInfoList as answer answerIndex}}\n\t\t\t<li class=\"list_more\">\n\t\t\t\t<div class=\"normal_question item\">\n\t\t\t\t\t<div class=\"item_header\">\n\t\t\t\t\t\t{{if answer.anonymous}}\n\t\t\t\t\t\t<div class=\"answerer_avatar\">\n\t\t\t\t\t\t\t<a class=\"anonymous\" href=\"javascript:;\"><img src=\"//www.lgstatic.com/lg-community-fed/community/modules/common/img/avatar_default_7225407.png\" width=\"44\" height=\"44\" alt=\"{{answer.userName}}\" /></a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<strong class=\"answerer_name user_card_float_wrap\">\n\t\t\t\t\t\t\t<a class=\"anonymous\" href=\"javascript:;\">匿名用户</a>\n\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t<span class=\"answerer_position\">可能来自遥远的阿贝尔2029星系群</span>\n\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t<div class=\"answerer_avatar\">\n\t\t\t\t\t\t\t{{if answer.answerUser.portrait && answer.answerUser.portrait !=''}}\n\t\t\t\t\t\t\t<a href=\"{{FE_zbase}}/user/userIndex-{{answer.answerUser.id}}.html\" target=\"_blank\" data-lg-tj-id=\"1ig0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerUser.id}}\"><img src=\"{{FE_lgsbase}}/{{answer.answerUser.portrait}}\" width=\"44\" height=\"44\" alt=\"{{answer.answerUser.userName}}\" /></a>\n\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t<a href=\"{{FE_zbase}}/user/userIndex-{{answer.answerUser.id}}.html\" target=\"_blank\" data-lg-tj-id=\"1ig0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerUser.id}}\"><img src=\"//www.lgstatic.com/lg-community-fed/community/modules/common/img/avatar_default_7225407.png\" width=\"44\" height=\"44\" alt=\"{{answer.answerUser.userName}}\" /></a>\n\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<strong class=\"answerer_name user_card_float_wrap\">\n\t\t\t\t\t\t\t<a href=\"{{FE_zbase}}/user/userIndex-{{answer.answerUser.id}}.html\" target=\"_blank\" data-lg-tj-id=\"1ih0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerUser.id}}\">{{answer.answerUser.userName}}</a>\n\t\t\t\t\t\t\t<span style=\"display: none;\">{{userinfoFloat = answer.answerUser}}</span>\n\t\t\t\t\t\t\t<!--\n    问答社区-浮动用户卡片 arttemplate模板\n-->\n\n<div class=\"user_card_float\">\n    <div class=\"user_card_float_box\">\n        <div class=\"avatar fl\">\n            <a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html\" target=\"_blank\">\n                {{if userinfoFloat.portrait && userinfoFloat.portrait != ''}}\n                <img src=\"{{FE_lgsbase}}/{{userinfoFloat.portrait}}\" width=\"54\" height=\"54\" />\n                {{else}}\n                <img src=\"../img/avatar_default.png\" width=\"54\" height=\"54\" />\n                {{/if}}\n            </a>\n        </div>\n        <div class=\"userinfo_base\">\n            <a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html\" target=\"_blank\">\n                {{if userinfoFloat.userName.length > 15}}\n                <span>{{userinfoFloat.userName.substring(0,14)}}...</span>\n                {{else}}\n                <span>{{userinfoFloat.userName}}</span>\n                {{/if}}\n                {{if userinfoFloat.sex == 'MALE'}}\n                <i class=\"boy\">男</i>\n                {{else if userinfoFloat.sex == 'FEMALE'}}\n                <i class=\"girl\">女</i>\n                {{/if}}\n            </a>\n        </div>\n        {{if userinfoFloat.id == curUserid}}\n        <!-- <a class=\"userinfo_edit\" href=\"javascript:;\">编辑</a> -->\n        {{/if}}\n        <p class=\"userinfo_job\" title=\"{{userinfoFloat.positionName}}\"><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html\" target=\"_blank\">{{userinfoFloat.positionName}}</a></p>\n        <p class=\"userinfo_intro\" title=\"{{userinfoFloat.introduce}}\"><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html\" target=\"_blank\">{{userinfoFloat.introduce}}</a></p>\n        <div class=\"user_status\">\n            <ul class=\"clearfix\">\n                <li><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html?newsType=QUESTION\" target=\"_blank\"><em>{{userinfoFloat.questionNum}}</em>提问</a></li>\n                <li><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html?newsType=ANSWER\" target=\"_blank\"><em>{{userinfoFloat.answerNum}}</em>回答</a></li>\n                <li><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html?newsType=ANSWER\" target=\"_blank\"><em>{{userinfoFloat.gainStarNum}}</em>获赞</a></li>\n            </ul>\n        </div>\n        {{if userinfoFloat.isFollow && userinfoFloat.id != curUserid}}\n        <a class=\"user_follow_btn btn btn_cancel\" href=\"javascript:;\" data-user-id=\"{{userinfoFloat.id}}\">已关注</a>\n        {{else if userinfoFloat.id != curUserid}}\n        <a class=\"user_follow_btn btn\" href=\"javascript:;\" data-user-id=\"{{userinfoFloat.id}}\"><i>加</i>关注</a>\n        {{/if}}\n        <span class=\"deck_out\"></span>\n        <span class=\"deck_in\"></span>\n    </div>\n</div>\n\n\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t<span class=\"answerer_position\">{{answer.answerUser.positionName}}</span>\n\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t<span class=\"item_tittle\">回答了</span>\n\t\t\t\t\t\t<span class=\"item_time fr\">{{answer.time}}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<h4 class=\"item_question question_name\" data-question-id=\"{{item.news.questionId}}\"><a href=\"{{FE_zbase}}/question/{{item.news.questionId}}.html\" target=\"_blank\" data-lg-tj-id=\"1ii0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{item.news.questionId}}\">{{item.news.questionTitle}}</a></h4>\n\t\t\t\t\t<div class=\"item_content clearfix\">\n\t\t\t\t\t\t<div class=\"support_bar fl\">\n\t\t\t\t\t\t\t<a class=\"{{if answer.isStar}} has_support {{/if}}\" href=\"javascript:;\" data-answer-id=\"{{answer.answerId}}\" data-lg-tj-id=\"1ij0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\">\n\t\t\t\t\t\t\t\t<i class=\"support_btn icon-glyph-like\"></i>\n\t\t\t\t\t\t\t\t<strong class=\"support_num\">{{answer.starNum}}</strong>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{{if answer.thumbnail && answer.thumbnail != ''}}\n\t\t\t\t\t\t<a class=\"answer_thumbnail_box fl\" href=\"javascript:;\" data-lg-tj-id=\"1ik0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\"><img class=\"answer_thumbnail fl\" src=\"{{answer.thumbnail.replace(/^https?\\:\\/\\/www\\.lagou\\.com/i, FE_lgsbase)}}\" /></a>\n\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t<p class=\"answer_summary\" data-lg-tj-id=\"1il0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\">\n\t\t\t\t\t\t\t{{answer.summary}}\n\t\t\t\t\t\t\t<a class=\"expand_answer\" href=\"javascript:;\" data-lg-tj-id=\"1im0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\">展开<i class=\"icon_expand\"></i></a>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<textarea class=\"answer_html\">{{#answer.answerContent}}</textarea>\n\t\t\t\t\t\t<div class=\"answer_full\"></div>\n\t\t\t\t\t\t<div class=\"item_status status_bar\">\n\t\t\t\t\t\t\t<span class=\"status_item\"><a href=\"{{FE_zbase}}/answer/{{answer.answerId}}.html\" target=\"_blank\" data-lg-tj-id=\"1in0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\"><em class=\"comment_num highlight\">{{answer.commentNum}}</em>条评论</a></span>\n\t\t\t\t\t\t\t<!-- <span class=\"status_item\">来自<em class=\"from\">{{if item.news.source == 'PC'}} lagou.com {{else if item.news.source == 'APP'}} 拉勾APP {{else}} lagou.com {{/if}}</em></span> -->\n\t\t\t\t\t\t\t<span class=\"status_item\"><a class=\"share_popup_btn\" href=\"javascript:;\" data-share-url=\"{{FE_zbase}}/share/answer_{{answer.answerId}}.html\" data-lg-tj-id=\"1Fa0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\">分享</a></span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t\t{{/each}}\n\t\t{{else if item.type == 'QUESTION_ADD'}}\n\t\t<li class=\"list_more\">\n\t\t\t<div class=\"normal_question_no_answer item\">\n\t\t\t\t<span class=\"item_time fr\">{{item.news.time}}</span>\n\t\t\t\t<h4 class=\"item_question question_name\" data-question-id=\"{{item.news.questionId}}\"><a href=\"{{FE_zbase}}/question/{{item.news.questionId}}.html\" target=\"_blank\" data-lg-tj-id=\"1i50\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{item.news.questionId}}\">{{item.news.questionTitle}}</a></h4>\n\t\t\t\t{{if item.news.questionContent}}\n\t\t\t\t<p class=\"item_question_desc\" data-question-id=\"{{item.news.questionId}}\"><a href=\"{{FE_zbase}}/question/{{item.news.questionId}}.html\" target=\"_blank\">{{item.news.questionContent}}</a></p>\n\t\t\t\t{{/if}}\n\t\t\t\t<div class=\"item_content clearfix\">\n\t\t\t\t\t<div class=\"item_status status_bar\">\n\t\t\t\t\t\t<span class=\"status_item\"><a href=\"{{FE_zbase}}/question/{{item.news.questionId}}.html\" target=\"_blank\" data-lg-tj-id=\"1i60\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{item.news.questionId}}\"><em class=\"answer_num highlight\">{{item.news.answerNum}}</em>个回答</a></span>\n\t\t\t\t\t\t<span class=\"status_item\"><a href=\"{{FE_zbase}}/question/{{item.news.questionId}}.html\" target=\"_blank\" data-lg-tj-id=\"1i70\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{item.news.questionId}}\"><em class=\"follow_num highlight\">{{item.news.attentionNum}}</em>人关注</a></span>\n\t\t\t\t\t\t<!-- <span class=\"status_item\">来自<em class=\"from\">{{if item.news.source == 'PC'}} lagou.com {{else if item.news.source == 'APP'}} 拉勾APP {{else}} lagou.com {{/if}}</em></span> -->\n\t\t\t\t\t\t<span class=\"status_item\"><a class=\"share_popup_btn\" href=\"javascript:;\" data-share-url=\"{{FE_zbase}}/share/question_{{item.news.questionId}}.html\" data-lg-tj-id=\"1Fb0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{item.news.questionId}}\">分享</a></span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</li>\n\t\t{{else if item.type == 'QUESTION_TOP' && item.news.answerInfoList && item.news.answerInfoList.length > 1}}\n\t\t<li class=\"list_more\">\n\t\t\t<div class=\"essence_question_list item clearfix\">\n\t\t\t\t<!-- <h4 class=\"item_question question_name\" data-question-id=\"{{item.news.questionId}}\"><a href=\"{{FE_zbase}}/question/{{item.news.questionId}}.html\" target=\"_blank\">{{item.news.questionTitle}}</a></h4> -->\n\t\t\t\t<ul class=\"list\">\n\t\t\t\t\t{{each item.news.answerInfoList as answer answerIndex}}\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<div class=\"essence_question item\">\n\t\t\t\t\t\t\t<div class=\"item_header\">\n\t\t\t\t\t\t\t\t{{if answer.anonymous}}\n\t\t\t\t\t\t\t\t<div class=\"answerer_avatar\">\n\t\t\t\t\t\t\t\t\t<a class=\"anonymous\" href=\"javascript:;\"><img src=\"//www.lgstatic.com/lg-community-fed/community/modules/common/img/avatar_default_7225407.png\" width=\"44\" height=\"44\" alt=\"匿名用户\" /></a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<strong class=\"answerer_name\">\n\t\t\t\t\t\t\t\t\t<a class=\"anonymous\" href=\"javascript:;\">匿名用户</a>\n\t\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t\t\t<span class=\"answerer_position\">可能来自遥远的阿贝尔2029星系群</span>\n\t\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t<div class=\"answerer_avatar\">\n\t\t\t\t\t\t\t\t\t{{if answer.answerUser.portrait && answer.answerUser.portrait !=''}}\n\t\t\t\t\t\t\t\t\t<a href=\"{{FE_zbase}}/user/userIndex-{{answer.answerUser.id}}.html\" target=\"_blank\" data-lg-tj-id=\"1i80\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerUser.id}}\"><img src=\"{{FE_lgsbase}}/{{answer.answerUser.portrait}}\" width=\"44\" height=\"44\" alt=\"{{answer.answerUser.userName}}\" /></a>\n\t\t\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t\t\t<a href=\"{{FE_zbase}}/user/userIndex-{{answer.answerUser.id}}.html\" target=\"_blank\" data-lg-tj-id=\"1i80\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerUser.id}}\"><img src=\"//www.lgstatic.com/lg-community-fed/community/modules/common/img/avatar_default_7225407.png\" width=\"44\" height=\"44\" alt=\"{{answer.answerUser.userName}}\" /></a>\n\t\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<strong class=\"answerer_name user_card_float_wrap\">\n\t\t\t\t\t\t\t\t\t<a href=\"{{FE_zbase}}/user/userIndex-{{answer.answerUser.id}}.html\" target=\"_blank\" data-lg-tj-id=\"1i80\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerUser.id}}\">{{answer.answerUser.userName}}</a>\n\t\t\t\t\t\t\t\t\t<span style=\"display: none;\">{{userinfoFloat = answer.answerUser}}</span>\n\t\t\t\t\t\t\t\t\t<!--\n    问答社区-浮动用户卡片 arttemplate模板\n-->\n\n<div class=\"user_card_float\">\n    <div class=\"user_card_float_box\">\n        <div class=\"avatar fl\">\n            <a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html\" target=\"_blank\">\n                {{if userinfoFloat.portrait && userinfoFloat.portrait != ''}}\n                <img src=\"{{FE_lgsbase}}/{{userinfoFloat.portrait}}\" width=\"54\" height=\"54\" />\n                {{else}}\n                <img src=\"../img/avatar_default.png\" width=\"54\" height=\"54\" />\n                {{/if}}\n            </a>\n        </div>\n        <div class=\"userinfo_base\">\n            <a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html\" target=\"_blank\">\n                {{if userinfoFloat.userName.length > 15}}\n                <span>{{userinfoFloat.userName.substring(0,14)}}...</span>\n                {{else}}\n                <span>{{userinfoFloat.userName}}</span>\n                {{/if}}\n                {{if userinfoFloat.sex == 'MALE'}}\n                <i class=\"boy\">男</i>\n                {{else if userinfoFloat.sex == 'FEMALE'}}\n                <i class=\"girl\">女</i>\n                {{/if}}\n            </a>\n        </div>\n        {{if userinfoFloat.id == curUserid}}\n        <!-- <a class=\"userinfo_edit\" href=\"javascript:;\">编辑</a> -->\n        {{/if}}\n        <p class=\"userinfo_job\" title=\"{{userinfoFloat.positionName}}\"><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html\" target=\"_blank\">{{userinfoFloat.positionName}}</a></p>\n        <p class=\"userinfo_intro\" title=\"{{userinfoFloat.introduce}}\"><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html\" target=\"_blank\">{{userinfoFloat.introduce}}</a></p>\n        <div class=\"user_status\">\n            <ul class=\"clearfix\">\n                <li><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html?newsType=QUESTION\" target=\"_blank\"><em>{{userinfoFloat.questionNum}}</em>提问</a></li>\n                <li><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html?newsType=ANSWER\" target=\"_blank\"><em>{{userinfoFloat.answerNum}}</em>回答</a></li>\n                <li><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html?newsType=ANSWER\" target=\"_blank\"><em>{{userinfoFloat.gainStarNum}}</em>获赞</a></li>\n            </ul>\n        </div>\n        {{if userinfoFloat.isFollow && userinfoFloat.id != curUserid}}\n        <a class=\"user_follow_btn btn btn_cancel\" href=\"javascript:;\" data-user-id=\"{{userinfoFloat.id}}\">已关注</a>\n        {{else if userinfoFloat.id != curUserid}}\n        <a class=\"user_follow_btn btn\" href=\"javascript:;\" data-user-id=\"{{userinfoFloat.id}}\"><i>加</i>关注</a>\n        {{/if}}\n        <span class=\"deck_out\"></span>\n        <span class=\"deck_in\"></span>\n    </div>\n</div>\n\n\t\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t\t\t<span class=\"answerer_position\">{{answer.answerUser.positionName}}</span>\n\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t<span class=\"item_tittle\">回答了</span>\n\t\t\t\t\t\t\t\t<span class=\"item_time fr\">{{answer.time}}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<h4 class=\"item_question question_name\" data-question-id=\"{{item.news.questionId}}\"><a href=\"{{FE_zbase}}/question/{{item.news.questionId}}.html\" target=\"_blank\" data-lg-tj-id=\"1i90\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{item.news.questionId}}\">{{item.news.questionTitle}}</a></h4>\n\t\t\t\t\t\t\t<div class=\"item_content clearfix\">\n\t\t\t\t\t\t\t\t<div class=\"support_bar fl\">\n\t\t\t\t\t\t\t\t\t<a class=\"{{if answer.isStar}} has_support {{/if}}\" href=\"javascript:;\" data-answer-id=\"{{answer.answerId}}\" data-lg-tj-id=\"1ia0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\">\n\t\t\t\t\t\t\t\t\t\t<i class=\"support_btn icon-glyph-like\"></i>\n\t\t\t\t\t\t\t\t\t\t<strong class=\"support_num\">{{answer.starNum}}</strong>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{{if answer.thumbnail && answer.thumbnail != ''}}\n\t\t\t\t\t\t\t\t<a class=\"answer_thumbnail_box fl\" href=\"javascript:;\" data-lg-tj-id=\"1ib0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\"><img class=\"answer_thumbnail\" src=\"{{answer.thumbnail.replace(/^https?\\:\\/\\/www\\.lagou\\.com/i, FE_lgsbase)}}\" /></a>\n\t\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t\t\t<p class=\"answer_summary\" data-lg-tj-id=\"1ic0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\">\n\t\t\t\t\t\t\t\t\t{{answer.summary}}\n\t\t\t\t\t\t\t\t\t<a class=\"expand_answer\" href=\"javascript:;\" data-lg-tj-id=\"1id0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\">展开<i class=\"icon_expand\"></i></a>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t<textarea class=\"answer_html\">{{#answer.answerContent}}</textarea>\n\t\t\t\t\t\t\t\t<div class=\"answer_full\"></div>\n\t\t\t\t\t\t\t\t<div class=\"item_status status_bar\">\n\t\t\t\t\t\t\t\t\t<span class=\"status_item\"><a href=\"{{FE_zbase}}/answer/{{answer.answerId}}.html\" target=\"_blank\" data-lg-tj-id=\"1ie0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\"><em class=\"comment_num highlight\">{{answer.commentNum}}</em>条评论</a></span>\n\t\t\t\t\t\t\t\t\t<!-- <span class=\"status_item\">来自<em class=\"from\">{{if item.news.source == 'PC'}} lagou.com {{else if item.news.source == 'APP'}} 拉勾APP {{else}} lagou.com {{/if}}</em></span> -->\n\t\t\t\t\t\t\t\t\t<span class=\"status_item\"><a class=\"share_popup_btn\" href=\"javascript:;\" data-share-url=\"{{FE_zbase}}/share/answer_{{answer.answerId}}.html\" data-lg-tj-id=\"1Fc0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\">分享</a></span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</li>\n\t\t\t\t\t{{/each}}\n\t\t\t\t</ul>\n\t\t\t\t<a class=\"more_answer fr\" href=\"{{FE_zbase}}/question/{{item.news.questionId}}.html\" target=\"_blank\" data-lg-tj-id=\"1if0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{item.news.questionId}}\">查看全部<span class=\"answer_num\">{{item.news.answerNum}}</span>个回答</a>\n\t\t\t</div>\n\t\t</li>\n\t\t{{else if item.type == 'QUESTION_TOP' && item.news.answerInfoList && item.news.answerInfoList.length > 0}}\n\t\t\t{{each item.news.answerInfoList as answer answerIndex}}\n\t\t\t<li class=\"list_more\">\n\t\t\t\t<div class=\"essence_question item\">\n\t\t\t\t\t<div class=\"item_header\">\n\t\t\t\t\t\t{{if answer.anonymous}}\n\t\t\t\t\t\t<div class=\"answerer_avatar\">\n\t\t\t\t\t\t\t<a class=\"anonymous\" href=\"javascript:;\"><img src=\"//www.lgstatic.com/lg-community-fed/community/modules/common/img/avatar_default_7225407.png\" width=\"44\" height=\"44\" alt=\"匿名用户\" /></a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<strong class=\"answerer_name user_card_float_wrap\">\n\t\t\t\t\t\t\t<a class=\"anonymous\" href=\"javascript:;\">匿名用户</a>\n\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t<span class=\"answerer_position\">可能来自遥远的阿贝尔2029星系群</span>\n\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t<div class=\"answerer_avatar\">\n\t\t\t\t\t\t\t{{if answer.answerUser.portrait && answer.answerUser.portrait !=''}}\n\t\t\t\t\t\t\t<a href=\"{{FE_zbase}}/user/userIndex-{{answer.answerUser.id}}.html\" target=\"_blank\" data-lg-tj-id=\"1ig0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerUser.id}}\"><img src=\"{{FE_lgsbase}}/{{answer.answerUser.portrait}}\" width=\"44\" height=\"44\" alt=\"{{answer.answerUser.userName}}\" /></a>\n\t\t\t\t\t\t\t{{else}}\n\t\t\t\t\t\t\t<a href=\"{{FE_zbase}}/user/userIndex-{{answer.answerUser.id}}.html\" target=\"_blank\" data-lg-tj-id=\"1ig0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerUser.id}}\"><img src=\"//www.lgstatic.com/lg-community-fed/community/modules/common/img/avatar_default_7225407.png\" width=\"44\" height=\"44\" alt=\"{{answer.answerUser.userName}}\" /></a>\n\t\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<strong class=\"answerer_name user_card_float_wrap\">\n\t\t\t\t\t\t\t<a href=\"{{FE_zbase}}/user/userIndex-{{answer.answerUser.id}}.html\" target=\"_blank\" data-lg-tj-id=\"1ih0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerUser.id}}\">{{answer.answerUser.userName}}</a>\n\t\t\t\t\t\t\t<span style=\"display: none;\">{{userinfoFloat = answer.answerUser}}</span>\n\t\t\t\t\t\t\t<!--\n    问答社区-浮动用户卡片 arttemplate模板\n-->\n\n<div class=\"user_card_float\">\n    <div class=\"user_card_float_box\">\n        <div class=\"avatar fl\">\n            <a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html\" target=\"_blank\">\n                {{if userinfoFloat.portrait && userinfoFloat.portrait != ''}}\n                <img src=\"{{FE_lgsbase}}/{{userinfoFloat.portrait}}\" width=\"54\" height=\"54\" />\n                {{else}}\n                <img src=\"../img/avatar_default.png\" width=\"54\" height=\"54\" />\n                {{/if}}\n            </a>\n        </div>\n        <div class=\"userinfo_base\">\n            <a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html\" target=\"_blank\">\n                {{if userinfoFloat.userName.length > 15}}\n                <span>{{userinfoFloat.userName.substring(0,14)}}...</span>\n                {{else}}\n                <span>{{userinfoFloat.userName}}</span>\n                {{/if}}\n                {{if userinfoFloat.sex == 'MALE'}}\n                <i class=\"boy\">男</i>\n                {{else if userinfoFloat.sex == 'FEMALE'}}\n                <i class=\"girl\">女</i>\n                {{/if}}\n            </a>\n        </div>\n        {{if userinfoFloat.id == curUserid}}\n        <!-- <a class=\"userinfo_edit\" href=\"javascript:;\">编辑</a> -->\n        {{/if}}\n        <p class=\"userinfo_job\" title=\"{{userinfoFloat.positionName}}\"><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html\" target=\"_blank\">{{userinfoFloat.positionName}}</a></p>\n        <p class=\"userinfo_intro\" title=\"{{userinfoFloat.introduce}}\"><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html\" target=\"_blank\">{{userinfoFloat.introduce}}</a></p>\n        <div class=\"user_status\">\n            <ul class=\"clearfix\">\n                <li><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html?newsType=QUESTION\" target=\"_blank\"><em>{{userinfoFloat.questionNum}}</em>提问</a></li>\n                <li><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html?newsType=ANSWER\" target=\"_blank\"><em>{{userinfoFloat.answerNum}}</em>回答</a></li>\n                <li><a href=\"{{FE_zbase}}/user/userIndex-{{userinfoFloat.id}}.html?newsType=ANSWER\" target=\"_blank\"><em>{{userinfoFloat.gainStarNum}}</em>获赞</a></li>\n            </ul>\n        </div>\n        {{if userinfoFloat.isFollow && userinfoFloat.id != curUserid}}\n        <a class=\"user_follow_btn btn btn_cancel\" href=\"javascript:;\" data-user-id=\"{{userinfoFloat.id}}\">已关注</a>\n        {{else if userinfoFloat.id != curUserid}}\n        <a class=\"user_follow_btn btn\" href=\"javascript:;\" data-user-id=\"{{userinfoFloat.id}}\"><i>加</i>关注</a>\n        {{/if}}\n        <span class=\"deck_out\"></span>\n        <span class=\"deck_in\"></span>\n    </div>\n</div>\n\n\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t<span class=\"answerer_position\">{{answer.answerUser.positionName}}</span>\n\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t<span class=\"item_tittle\">回答了</span>\n\t\t\t\t\t\t<span class=\"item_time fr\">{{answer.time}}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<h4 class=\"item_question question_name\" data-question-id=\"{{item.news.questionId}}\"><a href=\"{{FE_zbase}}/question/{{item.news.questionId}}.html\" target=\"_blank\" data-lg-tj-id=\"1ii0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{item.news.questionId}}\">{{item.news.questionTitle}}</a></h4>\n\t\t\t\t\t<div class=\"item_content clearfix\">\n\t\t\t\t\t\t<div class=\"support_bar fl\">\n\t\t\t\t\t\t\t<a class=\"{{if answer.isStar}} has_support {{/if}}\" href=\"javascript:;\" data-answer-id=\"{{answer.answerId}}\" data-lg-tj-id=\"1ij0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\">\n\t\t\t\t\t\t\t\t<i class=\"support_btn icon-glyph-like\"></i>\n\t\t\t\t\t\t\t\t<strong class=\"support_num\">{{answer.starNum}}</strong>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{{if answer.thumbnail && answer.thumbnail != ''}}\n\t\t\t\t\t\t<a class=\"answer_thumbnail_box fl\" href=\"javascript:;\" data-lg-tj-id=\"1ik0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\"><img class=\"answer_thumbnail fl\" src=\"{{answer.thumbnail.replace(/^https?\\:\\/\\/www\\.lagou\\.com/i, FE_lgsbase)}}\" /></a>\n\t\t\t\t\t\t{{/if}}\n\t\t\t\t\t\t<p class=\"answer_summary\" data-lg-tj-id=\"1il0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\">\n\t\t\t\t\t\t\t{{answer.summary}}\n\t\t\t\t\t\t\t<a class=\"expand_answer\" href=\"javascript:;\" data-lg-tj-id=\"1im0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\">展开<i class=\"icon_expand\"></i></a>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<textarea class=\"answer_html\">{{#answer.answerContent}}</textarea>\n\t\t\t\t\t\t<div class=\"answer_full\"></div>\n\t\t\t\t\t\t<div class=\"item_status status_bar\">\n\t\t\t\t\t\t\t<span class=\"status_item\"><a href=\"{{FE_zbase}}/answer/{{answer.answerId}}.html\" target=\"_blank\" data-lg-tj-id=\"1in0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\"><em class=\"comment_num highlight\">{{answer.commentNum}}</em>条评论</a></span>\n\t\t\t\t\t\t\t<!-- <span class=\"status_item\">来自<em class=\"from\">{{if item.news.source == 'PC'}} lagou.com {{else if item.news.source == 'APP'}} 拉勾APP {{else}} lagou.com {{/if}}</em></span> -->\n\t\t\t\t\t\t\t<span class=\"status_item\"><a class=\"share_popup_btn\" href=\"javascript:;\" data-share-url=\"{{FE_zbase}}/share/answer_{{answer.answerId}}.html\" data-lg-tj-id=\"1Fd0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{answer.answerId}}\">分享</a></span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t\t{{/each}}\n\t\t{{else if item.type == 'QUESTION_TOP'}}\n\t\t<li class=\"list_more\">\n\t\t\t<div class=\"essence_question_no_answer item\">\n\t\t\t\t<span class=\"item_time fr\">{{item.news.time}}</span>\n\t\t\t\t<h4 class=\"item_question question_name\" data-question-id=\"{{item.news.questionId}}\"><a href=\"{{FE_zbase}}/question/{{item.news.questionId}}.html\" target=\"_blank\" data-lg-tj-id=\"1io0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{item.news.questionId}}\">{{item.news.questionTitle}}</a></h4>\n\t\t\t\t{{if item.news.questionContent}}\n\t\t\t\t<p class=\"item_question_desc\" data-question-id=\"{{item.news.questionId}}\"><a href=\"{{FE_zbase}}/question/{{item.news.questionId}}.html\" target=\"_blank\">{{item.news.questionContent}}</a></p>\n\t\t\t\t{{/if}}\n\t\t\t\t<div class=\"item_content clearfix\">\n\t\t\t\t\t<div class=\"item_status status_bar\">\n\t\t\t\t\t\t<span class=\"status_item\"><a href=\"{{FE_zbase}}/question/{{item.news.questionId}}.html\" target=\"_blank\" data-lg-tj-id=\"1ip0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{item.news.questionId}}\"><em class=\"answer_num highlight\">{{item.news.answerNum}}</em>个回答</a></span>\n\t\t\t\t\t\t<span class=\"status_item\"><a href=\"{{FE_zbase}}/question/{{item.news.questionId}}.html\" target=\"_blank\" data-lg-tj-id=\"1iq0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{item.news.questionId}}\"><em class=\"follow_num highlight\">{{item.news.attentionNum}}</em>人关注</a></span>\n\t\t\t\t\t\t<!-- <span class=\"status_item\">来自<em class=\"from\">{{if item.news.source == 'PC'}} lagou.com {{else if item.news.source == 'APP'}} 拉勾APP {{else}} lagou.com {{/if}}</em></span> -->\n\t\t\t\t\t\t<span class=\"status_item\"><a class=\"share_popup_btn\" href=\"javascript:;\" data-share-url=\"{{FE_zbase}}/share/question_{{item.news.questionId}}.html\" data-lg-tj-id=\"1Fe0\" data-lg-tj-no=\"{{pageNum < 10 ? '0' + pageNum : pageNum}}{{index + 1 < 10 ? '0' + (index + 1) : index + 1}}\" data-lg-tj-cid=\"{{item.news.questionId}}\">分享</a></span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</li>\n\t\t{{/if}}\n\t{{/each}}\n{{/if}}\n";
				var htmlStr = template.compile(tpl)({
					topicNewsList: data.content.data.topicNewsList,
					curUserid: global.curUserid,
					pageNum: pageNum,
					FE_base: GLOBAL_DOMAIN.ctx,
					FE_zbase: GLOBAL_DOMAIN.zctx,
					FE_lgsbase: GLOBAL_DOMAIN.lgsctx,
					cdndomain: window.GLOBAL_CDN_DOMAIN
				});
				$('#topicNewsList').append(htmlStr);
				$('#topicNewsList .list_more .item_question').dotdotdot();
				$('#topicNewsList .list_more .answer_summary').dotdotdot({
					after: 'a.expand_answer',
					callback: function(isTruncated, orgContent) {
						if (isTruncated) {
							// $(orgContent.context).find('a.expand_answer').show();
						}
					}
				});
				$('#topicNewsList .list_more').removeClass('list_more');
				if (data.content.data.topicNewsList.length > 0 && $('#topicNewsList li.none_item').size() > 0) {
					$('#topicNewsList li.none_item').remove();
				}
				if (!data.content.data.hasMore) {
					$('#topicNews .news_loding').remove();
					$('#topicNewsMore').remove();
				}
			} else {
				console.log(data.message);
			}
		}).fail(function() {
			console.log('getMoreTopicNews error');
		}).always(function() {
			isLoadingNews = false;
			$('#topicNews .news_loding').hide();
			$('#topicNewsMore').removeClass('btn_disable').show();
		});
	}

	// 滚动加载
	$(window).scroll(function() {
		if (isLoadingNews || $('#topicNewsMore:visible').size() < 1) {
			return;
		}
		var curHeight = $(window).scrollTop() + $(window).height();
		if (curHeight > $('#topicNewsMore:visible').offset().top) {
			var topicId = $('#topicNewsMore:visible').attr('data-topic-id');
			getMoreNews(topicId);
		}
	});
});

/*!community/modules/common/img-zoom-tool/main.js*/
;/**
 * 富文本图片展示控制组件
 * 
 * @author fridayhu@lagou.com
 *
 * @require "community/modules/common/img-zoom-tool/main.less"
 * 
 */

define('community/modules/common/img-zoom-tool/main', ['require', 'exports', 'module'], function(require, exports, module) {

	$('body').on('click', '.editor_parse img', function(event) {
		$(this).toggleClass('zoomed');
	});

});

/*!community/page/topic-detail/main.js*/
;/**
 * 问答社区-话题页
 * 
 * @author fridayhu@lagou.com
 * 
 */

define('community/page/topic-detail/main', ['require', 'exports', 'module', 'community/modules/topic-detail/topic-card/main', 'community/modules/topic-detail/news/main', 'community/modules/common/img-zoom-tool/main'], function(require, exports, module) {

	// 话题卡片
	require('community/modules/topic-detail/topic-card/main');
	// 最新动态
	require('community/modules/topic-detail/news/main');
	// 富文本图片缩放组件
	require('community/modules/common/img-zoom-tool/main');

});
